#!/usr/bin/env python3
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

from collections.abc import Callable, Mapping, Sequence
from dataclasses import dataclass
from typing import Any

import cmk.ccc.version as cmk_version
from cmk.ccc.plugin_registry import Registry
from cmk.ccc.user import UserId
from cmk.gui.config import Config
from cmk.gui.data_source import DataSourceRegistry
from cmk.gui.i18n import _l
from cmk.gui.type_defs import (
    ColumnSpec,
    PainterParameters,
    SorterSpec,
    ViewName,
    ViewSpec,
    VisualLinkSpec,
)
from cmk.gui.utils.labels import filter_http_vars_for_simple_label_group
from cmk.utils import paths

builtin_views: dict[ViewName, ViewSpec] = {}

# Painters used in list of services views
service_view_painters = [
    ColumnSpec(name="service_state"),
    ColumnSpec(
        name="service_description",
        link_spec=VisualLinkSpec(type_name="views", name="service"),
    ),
    ColumnSpec(name="service_icons"),
    ColumnSpec(name="svc_plugin_output"),
    ColumnSpec(name="svc_state_age"),
    ColumnSpec(name="svc_check_age"),
    ColumnSpec(name="perfometer"),
]


# Same as list of services, but extended by the hostname
host_service_view_painters = service_view_painters[:]
host_service_view_painters.insert(
    1,
    ColumnSpec(
        name="host",
        link_spec=VisualLinkSpec(type_name="views", name="host"),
    ),
)

host_view_painters = [
    ColumnSpec(name="host_state"),
    ColumnSpec(
        name="host",
        link_spec=VisualLinkSpec(type_name="views", name="host"),
        tooltip="host_addresses",
    ),
    ColumnSpec(name="host_icons"),
    ColumnSpec(
        name="num_services_ok",
        link_spec=VisualLinkSpec(type_name="views", name="host_ok"),
    ),
    ColumnSpec(
        name="num_services_warn",
        link_spec=VisualLinkSpec(type_name="views", name="host_warn"),
    ),
    ColumnSpec(
        name="num_services_unknown",
        link_spec=VisualLinkSpec(type_name="views", name="host_unknown"),
    ),
    ColumnSpec(
        name="num_services_crit",
        link_spec=VisualLinkSpec(type_name="views", name="host_crit"),
    ),
    ColumnSpec(
        name="num_services_pending",
        link_spec=VisualLinkSpec(type_name="views", name="host_pending"),
    ),
]

builtin_views.update(
    {
        "allhosts": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "hosts",
            "description": _l(
                "Overall state of all hosts, with counts of services in the various states."
            ),
            "group_painters": [ColumnSpec(name="sitealias")],
            "hidden": False,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "allhosts",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": host_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("All hosts"),
            "topic": "overview",
            "sort_index": 20,
            "icon": "folder",
            "user_sortable": True,
            "single_infos": [],
            "context": {"siteopt": {}, "hostregex": {}},
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "unmonitored_services": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "service_discovery",
            "description": _l("Services not being monitored due to configuration."),
            "context": {
                "discovery_state": {
                    "discovery_state_ignored": "on",
                    "discovery_state_unmonitored": "on",
                    "discovery_state_vanished": "on",
                    "discovery_state_var0": "on",
                    "discovery_state_var1": "",
                    "discovery_state_var2": "on",
                }
            },
            "group_painters": [
                ColumnSpec(name="sitealias"),
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": False,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "unmonitored_services",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_discovery_service"),
                ColumnSpec(name="service_discovery_check"),
                ColumnSpec(name="service_discovery_state"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Unmonitored services"),
            "topic": "analyze",
            "sort_index": 60,
            "icon": {"icon": "services", "emblem": "warning"},
            "single_infos": [],
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "pending_discovery": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "service_discovery",
            "description": _l("Differences to currently monitored services on a host."),
            "context": {
                "discovery_state": {
                    "discovery_state_var0": "",
                    "discovery_state_var1": "on",
                    "discovery_state_var2": "on",
                }
            },
            "group_painters": [
                ColumnSpec(name="sitealias"),
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": False,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "pending_discovery",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_discovery_service"),
                ColumnSpec(name="service_discovery_check"),
                ColumnSpec(name="service_discovery_state"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Pending service discovery"),
            "topic": "analyze",
            "sort_index": 50,
            "icon": {"icon": "service_discovery", "emblem": "pending"},
            "single_infos": [],
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "allservices": {
            "browser_reload": 90,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All services grouped by hosts."),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "allservices",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("All services"),
            "icon": "services",
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "service_in_notification_period": {"is_service_in_notification_period": "-1"},
                "service_in_service_period": {},
                "optservicegroup": {"optservice_group": ""},
                "servicegroups": {},
                "service_notifications_enabled": {"is_service_notifications_enabled": "-1"},
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "in_downtime": {"is_in_downtime": "-1"},
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "-1"},
                "service_acknowledged": {"is_service_acknowledged": "-1"},
                "hostregex": {"host_regex": ""},
                "service_active_checks_enabled": {"is_service_active_checks_enabled": "-1"},
                "serviceregex": {"service_regex": ""},
                "check_command": {"check_command": ""},
                "svcstate": {},
                "opthostgroup": {"opthost_group": ""},
                "output": {"service_output": ""},
                "service_is_flapping": {"is_service_is_flapping": "-1"},
                "siteopt": {},
                "service_labels": {},
                "host_labels": {},
            },
            "link_from": {},
            "topic": "",
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "service_check_durations": {
            "browser_reload": 90,
            "column_headers": "pergroup",
            "context": {
                "service_active_checks_enabled": {"is_service_active_checks_enabled": "1"},
            },
            "datasource": "services",
            "description": _l(
                "All services ordered by their service check durations, grouped by their sites.\n"
            ),
            "force_checkboxes": False,
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                )
            ],
            "hidden": False,
            "hidebutton": False,
            "layout": "table",
            "mobile": False,
            "mustsearch": False,
            "name": "service_check_durations",
            "num_columns": 1,
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
                ColumnSpec(name="svc_check_duration"),
                ColumnSpec(name="svc_check_command"),
            ],
            "play_sounds": False,
            "public": True,
            "single_infos": [],
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="svc_check_duration", negate=True),
            ],
            "user_sortable": True,
            "title": _l("Service check durations"),
            "topic": "history",
            "sort_index": 70,
            "is_show_more": True,
            "icon": "service_duration",
            "owner": UserId.builtin(),
            "link_from": {},
            "add_context_to_title": True,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "comments": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "comments",
            "description": _l("All host- and service comments"),
            "group_painters": [ColumnSpec(name="comment_what")],
            "hidden": False,
            "hidebutton": False,
            "icon": "comment",
            "layout": "table",
            "mustsearch": False,
            "name": "comments",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="comment_author"),
                ColumnSpec(name="comment_time"),
                ColumnSpec(name="comment_expires"),
                ColumnSpec(name="comment_entry_type"),
                ColumnSpec(name="comment_comment"),
                ColumnSpec(name="host"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="comment_id"),
            ],
            "public": True,
            "sorters": [
                SorterSpec(sorter="comment_type", negate=False),
                SorterSpec(sorter="comment_author", negate=False),
            ],
            "title": _l("Comments"),
            "topic": "overview",
            "sort_index": 85,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "hostregex": {"host_regex": ""},
                "comment_entry_time": {},
                "serviceregex": {"service_regex": ""},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "comments_of_host": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "comments",
            "description": _l("Linkable view showing all comments of a specific host"),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "icon": "comment",
            "layout": "table",
            "mustsearch": False,
            "name": "comments_of_host",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="comment_author"),
                ColumnSpec(name="comment_comment"),
                ColumnSpec(name="comment_time"),
                ColumnSpec(name="comment_expires"),
                ColumnSpec(name="comment_entry_type"),
            ],
            "public": True,
            "sorters": [],
            "title": _l("Comments of host"),
            "topic": "monitoring",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {"siteopt": {}, "service": {"service": ""}},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "comments_of_service": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "comments",
            "description": _l("Linkable view showing all comments of a specific service"),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "icon": "comment",
            "layout": "table",
            "mustsearch": False,
            "name": "comments_of_service",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="comment_author"),
                ColumnSpec(name="comment_comment"),
                ColumnSpec(name="comment_time"),
                ColumnSpec(name="comment_expires"),
                ColumnSpec(name="comment_entry_type"),
            ],
            "public": True,
            "sorters": [],
            "title": _l("Comments of service"),
            "topic": "monitoring",
            "user_sortable": True,
            "single_infos": ["service", "host"],
            "context": {"siteopt": {}},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "downtimes": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "downtimes",
            "description": _l("All host- and service-downtimes"),
            "group_painters": [ColumnSpec(name="downtime_what")],
            "hidden": False,
            "hidebutton": False,
            "icon": "downtime",
            "layout": "table",
            "mustsearch": False,
            "name": "downtimes",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="downtime_origin"),
                ColumnSpec(name="downtime_author"),
                ColumnSpec(name="downtime_entry_time"),
                ColumnSpec(name="downtime_start_time"),
                ColumnSpec(name="downtime_end_time"),
                ColumnSpec(name="downtime_fixed"),
                ColumnSpec(name="downtime_duration"),
                ColumnSpec(name="downtime_recurring"),
                ColumnSpec(name="downtime_comment"),
            ],
            "public": True,
            "sorters": [
                SorterSpec(sorter="downtime_what", negate=False),
                SorterSpec(sorter="downtime_start_time", negate=False),
            ],
            "title": _l("Scheduled downtimes"),
            "topic": "overview",
            "sort_index": 80,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "-1"},
                "hostregex": {"host_regex": ""},
                "downtime_entry_time": {},
                "serviceregex": {"service_regex": ""},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "downtime_history": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log_events",
            "description": _l("All historic scheduled downtimes of hosts and services"),
            "group_painters": [ColumnSpec(name="log_what")],
            "hidden": False,
            "hidebutton": False,
            "icon": "downtime",
            "layout": "table",
            "mustsearch": False,
            "num_columns": 1,
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host_dt_hist"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svc_dt_hist"),
                ),
                ColumnSpec(name="log_state_info"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_what", negate=True),
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Downtime history"),
            "topic": "history",
            "sort_index": 30,
            "owner": UserId.builtin(),
            "name": "downtime_history",
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "log_type": {"log_type": "DOWNTIME ALERT"},
                "logtime": {"logtime_from": "60", "logtime_from_range": "86400"},
                "hostregex": {},
                "serviceregex": {},
                "log_state_info": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "api_downtimes": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "downtimes",
            "description": _l("All host- and service-downtimes (including ids)"),
            "group_painters": [ColumnSpec(name="downtime_what")],
            "hidden": True,
            "hidebutton": False,
            "icon": "downtime",
            "layout": "table",
            "mustsearch": False,
            "name": "api_downtimes",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="downtime_origin"),
                ColumnSpec(name="downtime_author"),
                ColumnSpec(name="downtime_entry_time"),
                ColumnSpec(name="downtime_start_time"),
                ColumnSpec(name="downtime_end_time"),
                ColumnSpec(name="downtime_fixed"),
                ColumnSpec(name="downtime_duration"),
                ColumnSpec(name="downtime_recurring"),
                ColumnSpec(name="downtime_comment"),
                ColumnSpec(name="downtime_id"),
            ],
            "public": True,
            "sorters": [
                SorterSpec(sorter="downtime_what", negate=False),
                SorterSpec(sorter="downtime_start_time", negate=False),
            ],
            "title": _l("Downtimes"),
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "-1"},
                "hostregex": {"host_regex": ""},
                "serviceregex": {"service_regex": ""},
                "downtime_id": {},
            },
            "link_from": {},
            "topic": "",
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "downtimes_of_host": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "downtimes",
            "description": _l("Lists all host downtimes."),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "icon": "downtime",
            "layout": "table",
            "mustsearch": False,
            "name": "downtimes_of_host",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="downtime_origin"),
                ColumnSpec(name="downtime_author"),
                ColumnSpec(name="downtime_entry_time"),
                ColumnSpec(name="downtime_start_time"),
                ColumnSpec(name="downtime_end_time"),
                ColumnSpec(name="downtime_fixed"),
                ColumnSpec(name="downtime_duration"),
                ColumnSpec(name="downtime_recurring"),
                ColumnSpec(name="downtime_comment"),
            ],
            "public": True,
            "sorters": [],
            "title": _l("Downtimes of host"),
            "topic": "history",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {"siteopt": {}},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "downtimes_of_service": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "downtimes",
            "description": _l("Lists all downtimes for services."),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "icon": "downtime",
            "layout": "table",
            "mustsearch": False,
            "name": "downtimes_of_service",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="downtime_origin"),
                ColumnSpec(name="downtime_author"),
                ColumnSpec(name="downtime_entry_time"),
                ColumnSpec(name="downtime_start_time"),
                ColumnSpec(name="downtime_end_time"),
                ColumnSpec(name="downtime_fixed"),
                ColumnSpec(name="downtime_duration"),
                ColumnSpec(name="downtime_recurring"),
                ColumnSpec(name="downtime_comment"),
            ],
            "public": True,
            "sorters": [],
            "title": _l("Downtimes of service"),
            "topic": "monitoring",
            "user_sortable": True,
            "single_infos": ["service", "host"],
            "context": {"siteopt": {}},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "host": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l(
                "All services of a given host. The host and site must be set via HTML variables."
            ),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": False,
            "icon": "services",
            "layout": "boxed",
            "mustsearch": False,
            "name": "host",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Services of host"),
            "topic": "monitoring",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {"siteopt": {}, "svcstate": {}, "serviceregex": {}},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "host_export": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l(
                "All services of a given host. The host and site must be set via HTTP variables."
            ),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "icon": "services",
            "layout": "boxed",
            "mustsearch": False,
            "num_columns": 1,
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_perf_data"),
                ColumnSpec(name="svc_check_command"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="svcdescr", negate=False)],
            "title": _l("Services of host"),
            "owner": UserId.builtin(),
            "name": "host_export",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {"siteopt": {}, "svcstate": {}, "serviceregex": {}},
            "link_from": {},
            "topic": "",
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hosts": {
            "browser_reload": 30,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("All services of hosts which match a name"),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": False,
            "name": "hosts",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Services of hosts"),
            "user_sortable": True,
            "single_infos": [],
            "context": {"hostregex": {"host_regex": ""}, "svcstate": {}, "siteopt": {}},
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "host_ok": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All services of a given host that are in state OK"),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "host_ok",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="svcdescr", negate=False)],
            "title": _l("OK services of host"),
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "svcstate": {"st0": "on", "st1": "", "st2": "", "st3": "", "stp": ""},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "host_warn": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All services of a given host that are in state WARN"),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "host_warn",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="svcdescr", negate=False)],
            "title": _l("WARN services of host"),
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "svcstate": {"st0": "", "st1": "on", "st2": "", "st3": "", "stp": ""},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "host_crit": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All services of a given host that are in state CRIT"),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "host_crit",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="svcdescr", negate=False)],
            "title": _l("CRIT services of host"),
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "svcstate": {"st0": "", "st1": "", "st2": "on", "st3": "", "stp": ""},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "host_unknown": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All services of a given host that are in state UNKNOWN"),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "host_unknown",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="svcdescr", negate=False)],
            "title": _l("UNKNOWN services of host"),
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "svcstate": {"st0": "", "st1": "", "st2": "", "st3": "on", "stp": ""},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "host_pending": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All services of a given host that are PENDING"),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "host_pending",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="svcdescr", negate=False)],
            "title": _l("PENDING services of host"),
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "svcstate": {"st0": "", "st1": "", "st2": "", "st3": "", "stp": "on"},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "problemsofhost": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l(
                "All problem services of a given host. The host and site must be set via HTTP variables."
            ),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "problemsofhost",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="svcdescr", negate=False)],
            "title": _l("Problems of host"),
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "svcstate": {"st0": "", "st1": "on", "st2": "on", "st3": "on", "stp": ""},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroup": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "hosts",
            "description": _l(
                "Lists members of a host group with the number of services in the different states."
            ),
            "group_painters": [
                ColumnSpec(name="site_icon"),
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": False,
            "name": "hostgroup",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": host_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Host group"),
            "user_sortable": True,
            "single_infos": ["hostgroup"],
            "context": {},
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroup_up": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "context": {
                "hoststate": {
                    "hoststate_filled": "1",
                    "hst0": "on",
                    "hst1": "",
                    "hst2": "",
                    "hstp": "",
                }
            },
            "datasource": "hosts",
            "description": _l(
                "Lists up members of a host group with the number of services in the different states."
            ),
            "group_painters": [
                ColumnSpec(name="site_icon"),
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": False,
            "name": "hostgroup_up",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": host_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Host group of up hosts"),
            "single_infos": ["hostgroup"],
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroup_down": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "context": {
                "hoststate": {
                    "hoststate_filled": "1",
                    "hst0": "",
                    "hst1": "on",
                    "hst2": "",
                    "hstp": "",
                }
            },
            "datasource": "hosts",
            "description": _l(
                "Lists down members of a host group with the number of services in the different states."
            ),
            "group_painters": [
                ColumnSpec(name="site_icon"),
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": False,
            "name": "hostgroup_down",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": host_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Host group of down hosts"),
            "single_infos": ["hostgroup"],
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroup_unreach": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "context": {
                "hoststate": {
                    "hoststate_filled": "1",
                    "hst0": "",
                    "hst1": "",
                    "hst2": "on",
                    "hstp": "",
                }
            },
            "datasource": "hosts",
            "description": _l(
                "Lists members of an unreachable host group with the number of services in the different states."
            ),
            "group_painters": [
                ColumnSpec(name="site_icon"),
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": False,
            "name": "hostgroup_unreach",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": host_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Host group of unreachable hosts"),
            "single_infos": ["hostgroup"],
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroup_pend": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "context": {
                "hoststate": {
                    "hoststate_filled": "1",
                    "hst0": "",
                    "hst1": "",
                    "hst2": "",
                    "hstp": "on",
                }
            },
            "datasource": "hosts",
            "description": _l(
                "Lists members of a pending host group with the number of services in the different states."
            ),
            "group_painters": [
                ColumnSpec(name="site_icon"),
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": False,
            "name": "hostgroup_pend",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": host_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Host group of pending"),
            "single_infos": ["hostgroup"],
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroupservices": {
            "browser_reload": 90,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("All services of a certain host group"),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "hostgroupservices",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Services of host group"),
            "user_sortable": True,
            "single_infos": ["hostgroup"],
            "context": {
                "service_in_notification_period": {"is_service_in_notification_period": "-1"},
                "optservicegroup": {"optservice_group": "", "neg_optservice_group": ""},
                "service_notifications_enabled": {"is_service_notifications_enabled": "-1"},
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "-1"},
                "service_acknowledged": {"is_service_acknowledged": "-1"},
                "hostregex": {"host_regex": ""},
                "service_active_checks_enabled": {"is_service_active_checks_enabled": "-1"},
                "serviceregex": {"service_regex": ""},
                "check_command": {"check_command": ""},
                "svcstate": {},
                "in_downtime": {"is_in_downtime": "-1"},
                "output": {"service_output": ""},
                "service_is_flapping": {"is_service_is_flapping": "-1"},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroupservices_ok": {
            "browser_reload": 60,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("All OK services of a certain host group"),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "hostgroupservices_ok",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("OK services of host group"),
            "user_sortable": True,
            "single_infos": ["hostgroup"],
            "context": {
                "service_in_notification_period": {"is_service_in_notification_period": "-1"},
                "optservicegroup": {"optservice_group": "", "neg_optservice_group": ""},
                "service_notifications_enabled": {"is_service_notifications_enabled": "-1"},
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "-1"},
                "service_acknowledged": {"is_service_acknowledged": "-1"},
                "hostregex": {"host_regex": ""},
                "service_active_checks_enabled": {"is_service_active_checks_enabled": "-1"},
                "serviceregex": {"service_regex": ""},
                "check_command": {"check_command": ""},
                "svcstate": {"st0": "on"},
                "in_downtime": {"is_in_downtime": "-1"},
                "output": {"service_output": ""},
                "service_is_flapping": {"is_service_is_flapping": "-1"},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroupservices_warn": {
            "browser_reload": 60,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("All WARN services of a certain host group"),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "hostgroupservices_warn",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("WARN services of host group"),
            "user_sortable": True,
            "single_infos": ["hostgroup"],
            "context": {
                "service_in_notification_period": {"is_service_in_notification_period": "-1"},
                "optservicegroup": {"optservice_group": "", "neg_optservice_group": ""},
                "service_notifications_enabled": {"is_service_notifications_enabled": "-1"},
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "-1"},
                "service_acknowledged": {"is_service_acknowledged": "-1"},
                "hostregex": {"host_regex": ""},
                "service_active_checks_enabled": {"is_service_active_checks_enabled": "-1"},
                "serviceregex": {"service_regex": ""},
                "check_command": {"check_command": ""},
                "svcstate": {"st1": "on"},
                "in_downtime": {"is_in_downtime": "-1"},
                "output": {"service_output": ""},
                "service_is_flapping": {"is_service_is_flapping": "-1"},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroupservices_crit": {
            "browser_reload": 60,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("All crit services of a certain host group"),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "hostgroupservices_crit",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("CRIT services of host group"),
            "user_sortable": True,
            "single_infos": ["hostgroup"],
            "context": {
                "service_in_notification_period": {"is_service_in_notification_period": "-1"},
                "optservicegroup": {"optservice_group": "", "neg_optservice_group": ""},
                "service_notifications_enabled": {"is_service_notifications_enabled": "-1"},
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "-1"},
                "service_acknowledged": {"is_service_acknowledged": "-1"},
                "hostregex": {"host_regex": ""},
                "service_active_checks_enabled": {"is_service_active_checks_enabled": "-1"},
                "serviceregex": {"service_regex": ""},
                "check_command": {"check_command": ""},
                "svcstate": {"st2": "on"},
                "in_downtime": {"is_in_downtime": "-1"},
                "output": {"service_output": ""},
                "service_is_flapping": {"is_service_is_flapping": "-1"},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroupservices_unknwn": {
            "browser_reload": 60,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("All unknown services of a certain host group"),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "hostgroupservices_unknwn",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("UNKNOWN services of host group"),
            "user_sortable": True,
            "single_infos": ["hostgroup"],
            "context": {
                "service_in_notification_period": {"is_service_in_notification_period": "-1"},
                "optservicegroup": {"optservice_group": "", "neg_optservice_group": ""},
                "service_notifications_enabled": {"is_service_notifications_enabled": "-1"},
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "-1"},
                "service_acknowledged": {"is_service_acknowledged": "-1"},
                "hostregex": {"host_regex": ""},
                "service_active_checks_enabled": {"is_service_active_checks_enabled": "-1"},
                "serviceregex": {"service_regex": ""},
                "check_command": {"check_command": ""},
                "svcstate": {"st3": "on"},
                "in_downtime": {"is_in_downtime": "-1"},
                "output": {"service_output": ""},
                "service_is_flapping": {"is_service_is_flapping": "-1"},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroupservices_pend": {
            "browser_reload": 60,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("All pending services of a certain host group"),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "hostgroupservices_pend",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("PEND services of host group"),
            "user_sortable": True,
            "single_infos": ["hostgroup"],
            "context": {
                "service_in_notification_period": {"is_service_in_notification_period": "-1"},
                "optservicegroup": {"optservice_group": "", "neg_optservice_group": ""},
                "service_notifications_enabled": {"is_service_notifications_enabled": "-1"},
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "-1"},
                "service_acknowledged": {"is_service_acknowledged": "-1"},
                "hostregex": {"host_regex": ""},
                "service_active_checks_enabled": {"is_service_active_checks_enabled": "-1"},
                "serviceregex": {"service_regex": ""},
                "check_command": {"check_command": ""},
                "svcstate": {"stp": "on"},
                "in_downtime": {"is_in_downtime": "-1"},
                "output": {"service_output": ""},
                "service_is_flapping": {"is_service_is_flapping": "-1"},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostgroups": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "merged_hostgroups",
            "description": _l(
                "A short overview over all host groups, without an explicity listing of the actual hosts"
            ),
            "group_painters": [],
            "hidden": False,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": False,
            "name": "hostgroups",
            "num_columns": 3,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(
                    name="hg_name",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroup"),
                ),
                ColumnSpec(name="hg_alias"),
                ColumnSpec(
                    name="hg_num_hosts_up",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroup_up"),
                ),
                ColumnSpec(
                    name="hg_num_hosts_down",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroup_down"),
                ),
                ColumnSpec(
                    name="hg_num_hosts_unreach",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroup_unreach"),
                ),
                ColumnSpec(
                    name="hg_num_hosts_pending",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroup_pend"),
                ),
                ColumnSpec(
                    name="hg_num_services_ok",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroupservices_ok"),
                ),
                ColumnSpec(
                    name="hg_num_services_warn",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroupservices_warn"),
                ),
                ColumnSpec(
                    name="hg_num_services_crit",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroupservices_crit"),
                ),
                ColumnSpec(
                    name="hg_num_services_unknown",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroupservices_unknwn"),
                ),
                ColumnSpec(
                    name="hg_num_services_pending",
                    link_spec=VisualLinkSpec(type_name="views", name="hostgroupservices_pend"),
                ),
            ],
            "public": True,
            "sorters": [],
            "title": _l("Host groups"),
            "topic": "overview",
            "icon": "hostgroups",
            "sort_index": 60,
            "user_sortable": True,
            "single_infos": [],
            "context": {"hostgroupnameregex": {}, "hostgroupvisibility": {}},
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostproblems": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "hosts",
            "description": _l(
                "A complete list of all host problems with a search form for selecting handled and unhandled"
            ),
            "group_painters": [ColumnSpec(name="host_state")],
            "hidden": False,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": False,
            "name": "hostproblems",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": host_view_painters,
            "play_sounds": True,
            "public": True,
            "sorters": [],
            "title": _l("Host problems"),
            "topic": "problems",
            "icon": "host_problems",
            "sort_index": 20,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "host_scheduled_downtime_depth": {"is_host_scheduled_downtime_depth": "0"},
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "hoststate": {"hst0": "", "hst1": "on", "hst2": "on", "hstp": ""},
                "hostregex": {"host_regex": ""},
                "opthostgroup": {"opthost_group": ""},
                "host_acknowledged": {"is_host_acknowledged": "-1"},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hoststatus": {
            "num_columns": 1,
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "hosts",
            "description": _l("Shows details of a host."),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "icon": "status",
            "layout": "dataset",
            "mustsearch": False,
            "name": "hoststatus",
            "owner": UserId.builtin(),
            "painters": [
                # 1. Identification and icons
                ColumnSpec(name="sitealias"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
                ColumnSpec(name="host_addresses"),
                ColumnSpec(name="alias"),
                ColumnSpec(name="host_labels"),
                ColumnSpec(name="host_icons"),
                # 2. State and metrics
                ColumnSpec(name="host_state"),
                ColumnSpec(name="host_plugin_output"),
                ColumnSpec(name="host_pnpgraph"),
                ColumnSpec(name="host_perf_data"),
                ColumnSpec(name="host_in_downtime"),
                # 2b. Serivce statistics
                ColumnSpec(name="num_services"),
                ColumnSpec(
                    name="num_services_ok",
                    link_spec=VisualLinkSpec(type_name="views", name="host_ok"),
                ),
                ColumnSpec(
                    name="num_services_warn",
                    link_spec=VisualLinkSpec(type_name="views", name="host_warn"),
                ),
                ColumnSpec(
                    name="num_services_crit",
                    link_spec=VisualLinkSpec(type_name="views", name="host_crit"),
                ),
                ColumnSpec(
                    name="num_services_unknown",
                    link_spec=VisualLinkSpec(type_name="views", name="host_unknown"),
                ),
                ColumnSpec(
                    name="num_services_pending",
                    link_spec=VisualLinkSpec(type_name="views", name="host_pending"),
                ),
                # 3. Runtime data, timestamps
                ColumnSpec(name="host_attempt"),
                ColumnSpec(name="host_state_age"),
                ColumnSpec(name="host_check_age"),
                ColumnSpec(name="host_next_check"),
                ColumnSpec(name="host_check_latency"),
                ColumnSpec(name="host_check_duration"),
                # 4. Notification
                ColumnSpec(name="host_notifper"),
                ColumnSpec(name="host_in_notifper"),
                ColumnSpec(name="host_notification_number"),
                ColumnSpec(name="host_last_notification"),
                ColumnSpec(name="host_next_notification"),
                ColumnSpec(name="host_notification_postponement_reason"),
                # 5. Configuration
                ColumnSpec(name="host_parents"),
                ColumnSpec(name="host_childs"),
                ColumnSpec(name="host_check_interval"),
                ColumnSpec(name="host_contact_groups"),
                ColumnSpec(name="host_contacts"),
                ColumnSpec(name="host_group_memberlist"),
                ColumnSpec(name="host_servicelevel"),
                ColumnSpec(name="host_check_command"),
                ColumnSpec(name="host_custom_vars"),
                ColumnSpec(name="host_custom_notes"),
            ],
            "public": True,
            "sorters": [],
            "title": _l("Status of host"),
            "topic": "monitoring",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {"siteopt": {}},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "pendingsvc": {
            "browser_reload": 30,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("Lists all services in state PENDING."),
            "group_painters": [
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                )
            ],
            "hidden": False,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "pendingsvc",
            "num_columns": 5,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                )
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [],
            "title": _l("Pending services"),
            "topic": "analyze",
            "icon": {"icon": "services", "emblem": "pending"},
            "sort_index": 50,
            "is_show_more": True,
            "user_sortable": True,
            "single_infos": [],
            "context": {"svcstate": {"st0": "", "st1": "", "st2": "", "st3": "", "stp": "on"}},
            "link_from": {},
            "add_context_to_title": True,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "searchhost": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "datasource": "hosts",
            "description": _l("A form for searching hosts using flexible filters"),
            "group_painters": [ColumnSpec(name="sitealias")],
            "hidden": False,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": True,
            "name": "searchhost",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": host_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [],
            "title": _l("Host search"),
            "topic": "overview",
            "sort_index": 30,
            "icon": {"icon": "folder", "emblem": "search"},
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "hostregex": {},
                "hostalias": {},
                "host_address": {},
                "host_labels": {},
                "host_tags": {},
                "siteopt": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "searchsvc": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l(
                "Almost all available filters, used for searching services and maybe doing actions"
            ),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": False,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": True,
            "name": "searchsvc",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Service search"),
            "topic": "overview",
            "icon": {"icon": "services", "emblem": "search"},
            "sort_index": 40,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "hostregex": {"host_regex": ""},
                "hostalias": {},
                "host_address": {},
                "host_labels": {},
                "host_tags": {},
                "siteopt": {},
                "serviceregex": {"service_regex": ""},
                "output": {"service_output": ""},
                "service_labels": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "service": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("Status of a single service, to be used for linking"),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "layout": "dataset",
            "mustsearch": False,
            "name": "service",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                # 1. Identification and icons
                ColumnSpec(name="sitealias"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="servicedesc"),
                ),
                ColumnSpec(name="service_labels"),
                ColumnSpec(name="service_icons"),
                # 2. State and metrics
                ColumnSpec(name="service_state"),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_long_plugin_output"),
                ColumnSpec(name="perfometer"),
                ColumnSpec(name="svc_pnpgraph"),
                ColumnSpec(name="svc_metrics"),
                ColumnSpec(name="svc_in_downtime"),
                # 3. Runtime data, timestamps
                ColumnSpec(name="svc_attempt"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
                ColumnSpec(name="svc_check_cache_info"),
                ColumnSpec(name="svc_next_check"),
                ColumnSpec(name="svc_last_time_ok"),
                ColumnSpec(name="svc_check_latency"),
                ColumnSpec(name="svc_check_duration"),
                # 4. Notifications
                ColumnSpec(name="svc_notifper"),
                ColumnSpec(name="svc_in_notifper"),
                ColumnSpec(name="svc_notification_number"),
                ColumnSpec(name="svc_last_notification"),
                ColumnSpec(name="svc_next_notification"),
                ColumnSpec(name="svc_notification_postponement_reason"),
                # 5. Configuration
                ColumnSpec(name="svc_check_interval"),
                ColumnSpec(name="svc_contact_groups"),
                ColumnSpec(name="svc_contacts"),
                ColumnSpec(name="svc_group_memberlist"),
                ColumnSpec(name="svc_servicelevel"),
                ColumnSpec(name="svc_check_command"),
                ColumnSpec(name="svc_perf_data"),
                ColumnSpec(name="svc_custom_vars"),
                ColumnSpec(name="check_manpage"),
                ColumnSpec(name="svc_custom_notes"),
            ],
            "public": True,
            "sorters": [],
            "title": _l("Service"),
            "user_sortable": True,
            "single_infos": ["service", "host"],
            "context": {"siteopt": {}},
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "servicedesc": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All services with a certain description"),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "icon": "status",
            "mustsearch": False,
            "name": "servicedesc",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="perfometer"),
            ],
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "user_sortable": True,
            "title": _l("All services with this description"),
            "single_infos": ["service"],
            "context": {"hostregex": {}, "svcstate": {}, "opthostgroup": {}},
            "link_from": {},
            "topic": "",
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "servicegroup": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("Services of a service group"),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "servicegroup",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Service group"),
            "user_sortable": True,
            "single_infos": ["servicegroup"],
            "context": {},
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "sitehosts": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "hosts",
            "description": _l("Link view showing all hosts of one site"),
            "group_painters": [
                ColumnSpec(name="site_icon"),
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitesvcs"),
                ),
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "sitehosts",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": host_view_painters,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("All hosts of site"),
            "user_sortable": True,
            "single_infos": [],
            "context": {"site": {}},
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "svcgroups": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "merged_servicegroups",
            "description": _l(
                "A short overview over all service groups, without explicity listing of the actual hosts and services"
            ),
            "group_painters": [],
            "hidden": False,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": False,
            "name": "svcgroups",
            "num_columns": 3,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(
                    name="sg_name",
                    link_spec=VisualLinkSpec(type_name="views", name="servicegroup"),
                ),
                ColumnSpec(name="sg_alias"),
                ColumnSpec(name="sg_num_services_ok"),
                ColumnSpec(name="sg_num_services_warn"),
                ColumnSpec(name="sg_num_services_crit"),
                ColumnSpec(name="sg_num_services_unknown"),
                ColumnSpec(name="sg_num_services_pending"),
            ],
            "public": True,
            "sorters": [],
            "title": _l("Service groups"),
            "topic": "overview",
            "icon": "servicegroups",
            "sort_index": 70,
            "user_sortable": True,
            "single_infos": [],
            "context": {"servicegroupnameregex": {}},
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "svcproblems": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All problems of services not currently in a downtime."),
            "group_painters": [],
            "hidden": False,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "svcproblems",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": host_service_view_painters,
            "play_sounds": True,
            "public": True,
            "sorters": [
                SorterSpec(sorter="svcstate", negate=True),
                SorterSpec(sorter="stateage", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Service problems"),
            "topic": "problems",
            "icon": "svc_problems",
            "sort_index": 30,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "in_downtime": {"is_in_downtime": "0"},
                "service_in_notification_period": {},
                "service_acknowledged": {},
                "svcstate": {"st0": "", "st1": "on", "st2": "on", "st3": "on", "stp": ""},
                "svchardstate": {},
                "serviceregex": {},
                "host_labels": {},
                "host_tags": {},
                "host_auxtags": {},
                "hoststate": {"hst0": "on", "hst1": "", "hst2": "", "hstp": "on"},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "searchpnp": {
            "browser_reload": 90,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("Search for services and display their graphs"),
            "group_painters": [
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
            ],
            "hidden": False,
            "hidebutton": False,
            "icon": {"icon": "service_graph", "emblem": "search"},
            "layout": "boxed_graph",
            "mustsearch": True,
            "name": "searchpnp",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [ColumnSpec(name="service_graphs")],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Search time graphs"),
            "topic": "history",
            "sort_index": 50,
            "is_show_more": True,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "service_process_performance_data": {"is_service_process_performance_data": "1"},
                "has_performance_data": {"is_has_performance_data": "1"},
                "hostregex": {},
                "hostalias": {},
                "host_address": {},
                "host_labels": {},
                "host_tags": {},
                "siteopt": {},
                "serviceregex": {},
                "output": {},
                "service_labels": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostpnp": {
            "browser_reload": 90,
            "column_headers": "off",
            "datasource": "services",
            "description": _l("All graphs for a certain host."),
            "group_painters": [
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                )
            ],
            "hidden": True,
            "hidebutton": False,
            "icon": "service_graph",
            "layout": "boxed_graph",
            "mustsearch": False,
            "name": "hostpnp",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [ColumnSpec(name="host_graphs")],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Service graphs of host"),
            "topic": "history",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "service_process_performance_data": {"is_service_process_performance_data": "1"},
                "has_performance_data": {"is_has_performance_data": "1"},
                "svcstate": {"st0": "on", "st1": "on", "st2": "on", "st3": "on", "stp": ""},
                "serviceregex": {},
                "check_command": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "recentsvc": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("Service whose state changed in the last 60 minutes"),
            "group_painters": [],
            "hidden": False,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "recentsvc",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": host_service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="stateage", negate=True)],
            "title": _l("Recently changed services"),
            "topic": "history",
            "sort_index": 80,
            "icon": {"icon": "services", "emblem": "warning"},
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "svc_last_state_change": {
                    "svc_last_state_change_from": "1",
                    "svc_last_state_change_from_range": "3600",
                },
                "svcstate": {"st0": "on", "st1": "on", "st2": "on", "st3": "on", "stp": ""},
                "siteopt": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "uncheckedsvc": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l(
                "Services that have not been checked for too long according to their configured check intervals."
            ),
            "group_painters": [
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                )
            ],
            "hidden": False,
            "hidebutton": False,
            "icon": "stale",
            "layout": "table",
            "mobile": False,
            "mustsearch": False,
            "name": "uncheckedsvc",
            "num_columns": 1,
            "painters": service_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "user_sortable": True,
            "title": _l("Stale services"),
            "topic": "problems",
            "sort_index": 40,
            "is_show_more": True,
            "owner": UserId.builtin(),
            "single_infos": [],
            "context": {
                "service_staleness": {"is_service_staleness": "1"},
                "service_scheduled_downtime_depth": {"is_service_scheduled_downtime_depth": "0"},
                "host_scheduled_downtime_depth": {"is_host_scheduled_downtime_depth": "0"},
                "hoststate": {"hst0": "on", "hst1": "on", "hst2": "on", "hstp": "on"},
            },
            "link_from": {},
            "add_context_to_title": True,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "stale_hosts": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "hosts",
            "description": _l("Hosts that have not been checked for too long."),
            "group_painters": [ColumnSpec(name="sitealias")],
            "hidden": True,
            "hidebutton": False,
            "icon": None,
            "layout": "boxed",
            "mobile": False,
            "mustsearch": False,
            "name": "stale_hosts",
            "num_columns": 1,
            "painters": host_view_painters,
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="host_name", negate=False),
            ],
            "title": _l("Stale hosts"),
            "topic": "problems",
            "user_sortable": True,
            "owner": UserId.builtin(),
            "single_infos": [],
            "context": {
                "host_staleness": {"is_host_staleness": "1"},
                "host_scheduled_downtime_depth": {"is_host_scheduled_downtime_depth": "0"},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "events": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log_events",
            "description": _l("All historic events of hosts or services (alerts, downtimes, etc.)"),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": False,
            "hidebutton": False,
            "icon": "history",
            "layout": "table",
            "mustsearch": False,
            "name": "events",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_type"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hostsvcevents"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svcevents"),
                ),
                ColumnSpec(name="log_state_info"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Events of host & services"),
            "topic": "history",
            "sort_index": 10,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "siteopt": {},
                "hostregex": {"host_regex": ""},
                "serviceregex": {"service_regex": ""},
                "logtime": {"logtime_from": "7", "logtime_from_range": "86400"},
                "log_plugin_output": {"log_plugin_output": ""},
                "log_state": {},
                "log_class": {},
                "log_notification_phase": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostevents": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log_host_events",
            "description": _l(
                "All historic events concerning the state of a certain host (without services)"
            ),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": True,
            "hidebutton": False,
            "icon": "history",
            "layout": "table",
            "mustsearch": False,
            "name": "hostevents",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_type"),
                ColumnSpec(name="log_state_info"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Events of host"),
            "topic": "history",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "logtime": {"logtime_from": "7", "logtime_from_range": "86400"},
                "log_state": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "host_dt_hist": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log_events",
            "description": _l("All historic scheduled downtimes of a certain host"),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "icon": "downtime",
            "layout": "table",
            "mustsearch": False,
            "num_columns": 1,
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_state_info"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Historic downtimes of host"),
            "topic": "history",
            "is_show_more": True,
            "owner": UserId.builtin(),
            "name": "host_dt_hist",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "log_type": {"log_type": "HOST DOWNTIME ALERT"},
                "logtime": {"logtime_from": "60", "logtime_from_range": "86400"},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "svcevents": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log_events",
            "description": _l("All historic events concerning the state of a certain service"),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": True,
            "hidebutton": False,
            "icon": "history",
            "layout": "table",
            "mustsearch": False,
            "name": "svcevents",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_type"),
                ColumnSpec(name="log_state_info"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Events of service"),
            "topic": "history",
            "user_sortable": True,
            "single_infos": ["service", "host"],
            "context": {
                "siteopt": {},
                "logtime": {"logtime_from": "7", "logtime_from_range": "86400"},
                "log_state": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "svc_dt_hist": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log_events",
            "description": _l("All historic scheduled downtimes of a certain service"),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "icon": "downtime",
            "layout": "table",
            "mustsearch": False,
            "num_columns": 1,
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_state_info"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Historic downtimes of service"),
            "topic": "history",
            "owner": UserId.builtin(),
            "name": "svc_dt_hist",
            "user_sortable": True,
            "single_infos": ["service", "host"],
            "context": {
                "siteopt": {},
                "log_type": {"log_type": "(HOST|SERVICE) DOWNTIME ALERT"},
                "logtime": {"logtime_from": "60", "logtime_from_range": "86400"},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostsvcevents": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log_events",
            "description": _l(
                "All historic events concerning the state of a certain host (including services)"
            ),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": True,
            "hidebutton": False,
            "icon": "history",
            "layout": "table",
            "mustsearch": False,
            "name": "hostsvcevents",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_type"),
                ColumnSpec(name="host"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svcevents"),
                ),
                ColumnSpec(name="log_state_info"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Events of host & services"),
            "topic": "history",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "logtime": {"logtime_from": "7", "logtime_from_range": "86400"},
                "log_state": {},
                "log_class": {},
                "log_notification_phase": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "logfile": {
            "browser_reload": 0,
            "column_headers": "off",
            "datasource": "log",
            "description": _l("Displays entries from the logfile of the monitoring core."),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": False,
            "hidebutton": False,
            "icon": {"icon": "event", "emblem": "search"},
            "layout": "table",
            "mustsearch": True,
            "name": "logfile",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_type"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hostsvcevents"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svcevents"),
                ),
                ColumnSpec(name="log_state_info"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Search history"),
            "topic": "history",
            "sort_index": 40,
            "is_show_more": True,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "optservicegroup": {"optservice_group": "", "neg_optservice_group": ""},
                "siteopt": {"site": ""},
                "log_class": {
                    "logclass0": "on",
                    "logclass1": "on",
                    "logclass2": "on",
                    "logclass3": "on",
                    "logclass4": "",
                    "logclass5": "on",
                    "logclass6": "",
                    "logclass8": "on",
                },
                "log_notification_phase": {},
                "hostregex": {"host_regex": ""},
                "serviceregex": {"service_regex": ""},
                "opthostgroup": {"opthost_group": "", "neg_opthost_group": ""},
                "logtime": {"logtime_from": "7", "logtime_from_range": "86400"},
                "log_state": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "sitesvcs_ok": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All OK services of a given site."),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "sitesvcs_ok",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="perfometer"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("OK services of site"),
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "siteopt": {},
                "optservicegroup": {},
                "hostregex": {},
                "serviceregex": {},
                "svcstate": {"st0": "on"},
                "opthostgroup": {},
                "host_check_command": {},
                "output": {},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "sitesvcs_warn": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All WARN services of a given site."),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "sitesvcs_warn",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="perfometer"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("WARN services of site"),
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "siteopt": {},
                "optservicegroup": {},
                "hostregex": {},
                "serviceregex": {},
                "svcstate": {"st1": "on"},
                "opthostgroup": {},
                "host_check_command": {},
                "output": {},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "sitesvcs_crit": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All CRIT services of a given site."),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "sitesvcs_crit",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="perfometer"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("CRIT services of site"),
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "siteopt": {},
                "optservicegroup": {},
                "hostregex": {},
                "serviceregex": {},
                "svcstate": {"st2": "on"},
                "opthostgroup": {},
                "host_check_command": {},
                "output": {},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "sitesvcs_unknwn": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All UNKNOWN services of a given site."),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "sitesvcs_unknwn",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="perfometer"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("UNKNOWN services of site"),
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "siteopt": {},
                "optservicegroup": {},
                "hostregex": {},
                "serviceregex": {},
                "svcstate": {"st3": "on"},
                "opthostgroup": {},
                "host_check_command": {},
                "output": {},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "sitesvcs_pend": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All pending services of a given site."),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "sitesvcs_pend",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="perfometer"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Pending services of site"),
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "siteopt": {},
                "optservicegroup": {},
                "hostregex": {},
                "serviceregex": {},
                "svcstate": {"stp": "on"},
                "opthostgroup": {},
                "host_check_command": {},
                "output": {},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "sitesvcs": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("All services of a given site."),
            "group_painters": [
                ColumnSpec(
                    name="host_with_state",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                )
            ],
            "hidden": True,
            "hidebutton": True,
            "layout": "boxed",
            "mustsearch": False,
            "name": "sitesvcs",
            "num_columns": 2,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="perfometer"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Services of site"),
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "siteopt": {},
                "optservicegroup": {},
                "hostregex": {},
                "serviceregex": {},
                "svcstate": {},
                "opthostgroup": {},
                "host_check_command": {},
                "output": {},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "alertstats": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "alert_stats",
            "description": _l("Shows number of alerts grouped for each service."),
            "group_painters": [],
            "hidden": False,
            "hidebutton": False,
            "layout": "boxed",
            "mustsearch": True,
            "name": "alertstats",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hostsvcevents"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svcevents"),
                ),
                ColumnSpec(name="alert_stats_problem"),
                ColumnSpec(name="alert_stats_crit"),
                ColumnSpec(name="alert_stats_unknown"),
                ColumnSpec(name="alert_stats_warn"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="alerts_crit", negate=True),
                SorterSpec(sorter="alerts_unknown", negate=True),
                SorterSpec(sorter="alerts_warn", negate=True),
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Alert statistics"),
            "topic": "problems",
            "sort_index": 50,
            "icon": "alerts",
            "is_show_more": True,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "optservicegroup": {"optservice_group": "", "neg_optservice_group": ""},
                "siteopt": {"site": ""},
                "hostregex": {"host_regex": ""},
                "serviceregex": {"service_regex": ""},
                "check_command": {"check_command": ""},
                "log_plugin_output": {"log_plugin_output": ""},
                "opthostgroup": {"opthost_group": "", "neg_opthost_group": ""},
                "host_check_command": {"host_check_command": ""},
                "logtime": {"logtime_from": "7", "logtime_from_range": "86400"},
                "log_state": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Special views for NagStaMon
        "nagstamon_hosts": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "hosts",
            "description": _l("The view is intended for NagStaMon as web service."),
            "group_painters": [ColumnSpec(name="host_state")],
            "hidden": True,
            "hidebutton": True,
            "layout": "table",
            "mustsearch": False,
            "name": "nagstamon_hosts",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                ),
                ColumnSpec(name="host_icons"),
                ColumnSpec(name="host_check_age"),
                ColumnSpec(name="host_state_age"),
                ColumnSpec(name="host_attempt"),
                ColumnSpec(name="host_state"),
                ColumnSpec(name="host_plugin_output"),
                ColumnSpec(name="host_in_downtime"),
                ColumnSpec(name="host_acknowledged"),
                ColumnSpec(name="host_address"),
                ColumnSpec(name="host_in_downtime"),
                ColumnSpec(name="host_acknowledged"),
                ColumnSpec(name="sitename_plain"),
                ColumnSpec(name="host_flapping"),
                ColumnSpec(name="host_is_active"),
                ColumnSpec(name="host_notifications_enabled"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [],
            "title": _l("Host problems for NagStaMon"),
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "host_scheduled_downtime_depth": {},
                "host_active_checks_enabled": {},
                "hoststate": {},
                "host_acknowledged": {},
                "host_notifications_enabled": {},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "nagstamon_svc": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l("This view is intended for usage as web service for NagStaMon."),
            "group_painters": [ColumnSpec(name="service_state")],
            "hidden": True,
            "hidebutton": True,
            "layout": "table",
            "mustsearch": False,
            "name": "nagstamon_svc",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="service_state"),
                ColumnSpec(name="svc_check_age"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_attempt"),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_flapping"),
                ColumnSpec(name="svc_notifications_enabled"),
                ColumnSpec(name="svc_is_active"),
                ColumnSpec(name="svc_in_downtime"),
                ColumnSpec(name="svc_acknowledged"),
                ColumnSpec(name="sitename_plain"),
                ColumnSpec(name="host_address"),
                ColumnSpec(name="svc_check_command"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="svcstate", negate=True),
                SorterSpec(sorter="stateage", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Service problems for NagStaMon"),
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "service_in_notification_period": {},
                "service_notifications_enabled": {},
                "hoststate": {},
                "service_acknowledged": {},
                "service_active_checks_enabled": {},
                "host_notifications_enabled": {},
                "svcstate": {"st0": "", "st1": "on", "st2": "on", "st3": "on", "stp": ""},
                "in_downtime": {},
            },
            "link_from": {},
            "topic": "",
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "perf_matrix": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "context": {
                "serviceregex": {"service_regex": ""},
                "service_in_notification_period": {},
                "service_notifications_enabled": {},
                "hoststate": {},
                "service_acknowledged": {},
                "service_active_checks_enabled": {},
                "host_notifications_enabled": {},
                "svcstate": {},
                "in_downtime": {},
                "has_performance_data": {"is_has_performance_data": "1"},
            },
            "datasource": "servicesbyhostgroup",
            "description": _l(
                "A matrix of performance data values from all hosts in a certain host group"
            ),
            "group_painters": [
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                )
            ],
            "hidden": True,
            "hidebutton": False,
            "icon": "matrix",
            "layout": "matrix",
            "num_columns": 12,
            "painters": [
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="perfometer"),
            ],
            "single_infos": ["hostgroup"],
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Matrix of performance data"),
            "user_sortable": True,
            "owner": UserId.builtin(),
            "public": True,
            "name": "perf_matrix",
            "link_from": {},
            "topic": "",
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "perf_matrix_search": {
            "browser_reload": 60,
            "column_headers": "pergroup",
            "context": {
                "hostregex": {},
                "host_address": {},
                "serviceregex": {},
                "output": {},
                "siteopt": {},
                "host_labels": {},
                "host_tags": {},
                "hostalias": {},
                "has_performance_data": {"is_has_performance_data": "1"},
                "service_labels": {},
            },
            "datasource": "services",
            "description": _l("A matrix of performance data values, grouped by hosts and services"),
            "group_painters": [
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                )
            ],
            "hidden": False,
            "hidebutton": False,
            "icon": "performance_data",
            "layout": "matrix",
            "num_columns": 12,
            "painters": [
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="perfometer"),
            ],
            "single_infos": [],
            "sorters": [
                SorterSpec(sorter="site_host", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "user_sortable": True,
            "mustsearch": True,
            "title": _l("Search performance data"),
            "topic": "history",
            "sort_index": 60,
            "owner": UserId.builtin(),
            "public": True,
            "name": "perf_matrix_search",
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        #
        #    ____            _
        #   | __ ) _   _ ___(_)_ __   ___  ___ ___
        #   |  _ \| | | / __| | '_ \ / _ \/ __/ __|
        #   | |_) | |_| \__ \ | | | |  __/\__ \__ \
        #   |____/ \__,_|___/_|_| |_|\___||___/___/
        #
        #    ___       _       _ _ _
        #   |_ _|_ __ | |_ ___| | (_) __ _  ___ _ __   ___ ___
        #    | || '_ \| __/ _ \ | | |/ _` |/ _ \ '_ \ / __/ _ \
        #    | || | | | ||  __/ | | | (_| |  __/ | | | (_|  __/
        #   |___|_| |_|\__\___|_|_|_|\__, |\___|_| |_|\___\___|
        #                            |___/
        #
        # All aggregations
        "aggr_frozen_diff": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l("Displays all BI aggregations."),
            "group_painters": [
                ColumnSpec(
                    name="aggr_group",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_group"),
                )
            ],
            "hidden": True,
            "hidebutton": False,
            "force_checkboxes": True,
            "icon": "aggr",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_all",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(name="aggr_treestate"),
                ColumnSpec(name="aggr_treestate_frozen_diff"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="aggr_group", negate=False),
                SorterSpec(sorter="aggr_name", negate=False),
            ],
            "title": _l("All differences in frozen aggregations"),
            "topic": "bi",
            "sort_index": 10,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "aggr_group": {},
                "aggr_group_tree": {},
                "aggr_hosts": {},
                "aggr_name": {},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_state": {
                    "birs-1": "on",
                    "birs0": "on",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "aggr_output": {"aggr_output": ""},
                "aggr_assumed_state": {
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "aggr_effective_state": {
                    "bies-1": "on",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
                "aggregation_types": {"aggr_type_frozen": "on", "aggr_type_dynamic": ""},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "aggr_all_frozen": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l("Displays all frozen BI aggregations."),
            "group_painters": [
                ColumnSpec(
                    name="aggr_group",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_group"),
                )
            ],
            "hidden": False,
            "hidebutton": False,
            "icon": "aggr",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_all_frozen",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(name="aggr_state"),
                ColumnSpec(name="aggr_treestate"),
                ColumnSpec(name="aggr_hosts"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="aggr_group", negate=False),
                SorterSpec(sorter="aggr_name", negate=False),
            ],
            "title": _l("All frozen aggregations"),
            "topic": "bi",
            "sort_index": 11,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "aggregation_types": {"aggr_type_dynamic": "", "aggr_type_frozen": "on"},
                "aggr_group": {},
                "aggr_group_tree": {},
                "aggr_hosts": {},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_state": {
                    "birs-1": "on",
                    "birs0": "on",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "aggr_output": {"aggr_output": ""},
                "aggr_assumed_state": {
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "aggr_effective_state": {
                    "bies-1": "on",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "aggr_all": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l("Displays all BI aggregations."),
            "group_painters": [
                ColumnSpec(
                    name="aggr_group",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_group"),
                )
            ],
            "hidden": False,
            "hidebutton": False,
            "icon": "aggr",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_all",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(name="aggr_state"),
                ColumnSpec(name="aggr_treestate"),
                ColumnSpec(name="aggr_hosts"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="aggr_group", negate=False),
                SorterSpec(sorter="aggr_name", negate=False),
            ],
            "title": _l("All aggregations"),
            "topic": "bi",
            "sort_index": 10,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "aggr_group": {},
                "aggr_group_tree": {},
                "aggr_hosts": {},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_state": {
                    "birs-1": "on",
                    "birs0": "on",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "aggr_output": {"aggr_output": ""},
                "aggr_assumed_state": {
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "aggr_effective_state": {
                    "bies-1": "on",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # All aggregations of a certain group
        "aggr_group": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l("Displays all aggregations of a certain group."),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "icon": "aggr",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_group",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(name="aggr_state"),
                ColumnSpec(name="aggr_treestate"),
                ColumnSpec(name="aggr_hosts"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="aggr_name", negate=False)],
            "title": _l("Aggregation group"),
            "topic": "bi",
            "user_sortable": True,
            "single_infos": ["aggr_group"],
            "context": {
                "aggr_hosts": {},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_state": {
                    "birs-1": "on",
                    "birs0": "on",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "aggr_output": {"aggr_output": ""},
                "aggr_assumed_state": {
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "aggr_effective_state": {
                    "bies-1": "on",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # All host-only aggregations
        "aggr_singlehosts": {
            "browser_reload": 0,
            "column_headers": "off",
            "datasource": "bi_host_aggregations",
            "description": _l("Lists all aggregations which only rely on information of one host."),
            "group_painters": [
                ColumnSpec(
                    name="aggr_group",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_group"),
                )
            ],
            "hidden": False,
            "hidebutton": True,
            "icon": "aggr_single",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_singlehosts",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_host"),
                ),
                ColumnSpec(name="host_icons"),
                ColumnSpec(name="aggr_treestate"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="aggr_group", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Single host aggregations"),
            "topic": "bi",
            "sort_index": 40,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "host_scheduled_downtime_depth": {"is_host_scheduled_downtime_depth": "-1"},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_group": {"aggr_group": ""},
                "aggr_state": {
                    "birs-1": "on",
                    "birs0": "on",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "aggr_output": {"aggr_output": ""},
                "hoststate": {},
                "siteopt": {"site": ""},
                "aggr_assumed_state": {
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "hostregex": {"host_regex": ""},
                "opthostgroup": {"opthost_group": "", "neg_opthost_group": ""},
                "aggr_effective_state": {
                    "bies-1": "on",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Aggregations that bear the name of a host
        "aggr_hostnameaggrs": {
            "browser_reload": 0,
            "column_headers": "off",
            "datasource": "bi_hostname_aggregations",
            "description": _l("Host related aggregations"),
            "group_painters": [
                ColumnSpec(
                    name="aggr_group",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_group"),
                )
            ],
            "hidden": False,
            "hidebutton": True,
            "icon": "aggr",
            "layout": "table",
            "mustsearch": False,
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_host"),
                ),
                ColumnSpec(name="host_icons"),
                ColumnSpec(name="aggr_treestate"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="aggr_group", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Host name aggregations"),
            "topic": "bi",
            "sort_index": 20,
            "name": "aggr_hostnameaggrs",
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "host_scheduled_downtime_depth": {"is_host_scheduled_downtime_depth": "-1"},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_group": {"aggr_group": ""},
                "aggr_state": {
                    "birs-1": "on",
                    "birs0": "on",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "aggr_output": {"aggr_output": ""},
                "hoststate": {},
                "siteopt": {"site": ""},
                "aggr_assumed_state": {
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "hostregex": {"host_regex": ""},
                "opthostgroup": {"opthost_group": "", "neg_opthost_group": ""},
                "aggr_effective_state": {
                    "bies-1": "on",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Single-Host Aggregations of a host
        "aggr_singlehost": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_host_aggregations",
            "description": _l("A single host related aggregation"),
            "group_painters": [ColumnSpec(name="aggr_name")],
            "hidden": True,
            "hidebutton": False,
            "icon": "aggr",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_singlehost",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(name="aggr_state"),
                ColumnSpec(name="aggr_treestate"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="aggr_name", negate=False)],
            "title": _l("Single-Host Aggregations of Host"),
            "topic": "bi",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {"siteopt": {}},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # All aggregations affected by a certain host
        "aggr_host": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l("All aggregations the given host is part of"),
            "group_painters": [
                ColumnSpec(
                    name="aggr_group",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_group"),
                )
            ],
            "hidden": True,
            "hidebutton": False,
            "icon": "aggr",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_host",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(name="aggr_state"),
                ColumnSpec(name="aggr_treestate"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="aggr_name", negate=False)],
            "title": _l("Aggregations affected by host"),
            "topic": "bi",
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "aggr_group": {},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_state": {
                    "birs-1": "on",
                    "birs0": "on",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "aggr_output": {"aggr_output": ""},
                "aggr_assumed_state": {
                    "bias-1": "on",
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "aggr_effective_state": {
                    "bies-1": "on",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
                "aggr_hosts": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # All aggregations affected by a certain service (one one site/host!)
        "aggr_service": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l("All aggregations affected by a certain service"),
            "group_painters": [
                ColumnSpec(
                    name="aggr_group",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_group"),
                )
            ],
            "hidden": True,
            "hidebutton": False,
            "icon": "aggr",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_service",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(name="aggr_state"),
                ColumnSpec(name="aggr_treestate"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [SorterSpec(sorter="aggr_name", negate=False)],
            "title": _l("Aggregations affected by service"),
            "topic": "bi",
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "aggr_group": {},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_state": {
                    "birs-1": "on",
                    "birs0": "on",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "aggr_output": {"aggr_output": ""},
                "aggr_assumed_state": {
                    "bias-1": "on",
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "aggr_effective_state": {
                    "bies-1": "on",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
                "aggr_service": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # All aggregations that have (real) problems
        "aggr_problems": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l(
                "All aggregations that have a non-OK state (honoring state assumptions)"
            ),
            "group_painters": [
                ColumnSpec(
                    name="aggr_group",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_group"),
                )
            ],
            "hidden": False,
            "hidebutton": False,
            "icon": "aggr",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_problems",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(name="aggr_state"),
                ColumnSpec(name="aggr_treestate"),
                ColumnSpec(name="aggr_hosts"),
            ],
            "play_sounds": True,
            "public": True,
            "sorters": [
                SorterSpec(sorter="aggr_group", negate=False),
                SorterSpec(sorter="aggr_name", negate=False),
            ],
            "title": _l("Problem aggregations"),
            "topic": "bi",
            "sort_index": 30,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "aggr_group": {},
                "aggr_hosts": {},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_state": {
                    "birs-1": "",
                    "birs0": "",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "aggr_output": {"aggr_output": ""},
                "aggr_assumed_state": {
                    "bias-1": "",
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "aggr_effective_state": {
                    "bies-1": "",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # All single-host aggregations with problems
        "aggr_hostproblems": {
            "browser_reload": 0,
            "column_headers": "off",
            "datasource": "bi_host_aggregations",
            "description": _l(
                "All single-host aggregations that are in non-OK state (honoring state assumptions)"
            ),
            "group_painters": [
                ColumnSpec(
                    name="aggr_group",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_group"),
                )
            ],
            "hidden": False,
            "hidebutton": True,
            "icon": "aggr_single_problem",
            "layout": "table",
            "mustsearch": False,
            "name": "aggr_hostproblems",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="aggr_host"),
                ),
                ColumnSpec(name="host_icons"),
                ColumnSpec(name="aggr_treestate"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="aggr_group", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Single host problems"),
            "topic": "bi",
            "sort_index": 50,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "host_scheduled_downtime_depth": {"is_host_scheduled_downtime_depth": "-1"},
                "aggr_name_regex": {"aggr_name_regex": ""},
                "aggr_group": {"aggr_group": "Hosts"},
                "aggr_state": {
                    "birs-1": "on",
                    "birs0": "on",
                    "birs1": "on",
                    "birs2": "on",
                    "birs3": "on",
                },
                "host_in_notification_period": {"is_host_in_notification_period": "-1"},
                "aggr_output": {"aggr_output": ""},
                "hoststate": {},
                "siteopt": {"site": ""},
                "aggr_assumed_state": {
                    "bias-1": "on",
                    "bias0": "on",
                    "bias1": "on",
                    "bias2": "on",
                    "bias3": "on",
                    "biasn": "on",
                },
                "hostregex": {"host_regex": ""},
                "opthostgroup": {"opthost_group": "", "neg_opthost_group": ""},
                "aggr_effective_state": {
                    "bies-1": "on",
                    "bies0": "on",
                    "bies1": "on",
                    "bies2": "on",
                    "bies3": "on",
                },
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Shows a single aggregation which has to be set via aggr_name=<Name>
        "aggr_single": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l("Shows a single aggregation."),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "icon": "aggr",
            "layout": "table",
            "mobile": False,
            "mustsearch": False,
            "name": "aggr_single",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_icons"),
                ColumnSpec(name="aggr_state"),
                ColumnSpec(name="aggr_treestate"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [],
            "title": _l("Single aggregation"),
            "topic": "bi",
            "user_sortable": True,
            "single_infos": ["aggr"],
            "context": {},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Shows minimal information about a multiple aggregation
        # Use together with output_format=python for API calls
        "aggr_all_api": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l(
                "List of all aggregations, containing the name of aggregations and state information"
            ),
            "group_painters": [],
            "hidden": True,
            "hidebutton": True,
            "icon": "aggr",
            "layout": "table",
            "mobile": False,
            "mustsearch": False,
            "name": "aggr_all_api",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_group"),
                ColumnSpec(name="aggr_name"),
                ColumnSpec(name="aggr_state_num"),
                ColumnSpec(name="aggr_output"),
                ColumnSpec(name="aggr_treestate"),
                ColumnSpec(name="aggr_in_downtime"),
                ColumnSpec(name="aggr_acknowledged"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [],
            "title": _l("List of all aggregations for simple API calls"),
            "topic": "bi",
            "user_sortable": True,
            "single_infos": [],
            "context": {},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Shows minimal information about a single aggregation which has to be set via aggr_name=<Name>.
        # Use together with output_format=python for API calls
        "aggr_single_api": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "bi_aggregations",
            "description": _l(
                "Single aggregation for simple API calls. Contains the state and state output."
            ),
            "group_painters": [],
            "hidden": True,
            "hidebutton": True,
            "icon": "aggr",
            "layout": "table",
            "mobile": False,
            "mustsearch": False,
            "name": "aggr_single_api",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="aggr_state_num"),
                ColumnSpec(name="aggr_output"),
                ColumnSpec(name="aggr_in_downtime"),
                ColumnSpec(name="aggr_acknowledged"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [],
            "title": _l("Single aggregation for simple API calls"),
            "topic": "bi",
            "user_sortable": True,
            "single_infos": ["aggr"],
            "context": {},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Summary of all aggregations for usage as web services
        "aggr_summary": {
            "browser_reload": 0,
            "column_headers": "off",
            "datasource": "bi_aggregations",
            "description": _l(
                "Simple summary page of all BI aggregates that is used as a web services."
            ),
            "group_painters": [],
            "hidden": True,
            "hidebutton": True,
            "icon": None,
            "layout": "boxed",
            "mobile": False,
            "mustsearch": False,
            "name": "aggr_summary",
            "num_columns": 1,
            "painters": [
                ColumnSpec(name="aggr_name"),
                ColumnSpec(name="aggr_state"),
                ColumnSpec(name="aggr_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [],
            "title": _l("BI aggregations summary state"),
            "topic": "bi",
            "user_sortable": True,
            "owner": UserId.builtin(),
            "single_infos": [],
            "context": {},
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Host group with boxed BIs for each host
        "aggr_hostgroup_boxed": {
            "browser_reload": 0,
            "column_headers": "off",
            "context": {"aggr_group": {"aggr_group": ""}, "hostregex": {"host_regex": ""}},
            "datasource": "bi_hostnamebygroup_aggregations",
            "description": _l("Host group with boxed BIs for each host\n"),
            "group_painters": [
                ColumnSpec(name="site_icon"),
                ColumnSpec(
                    name="sitealias",
                    link_spec=VisualLinkSpec(type_name="views", name="sitehosts"),
                ),
            ],
            "hidden": True,
            "hidebutton": False,
            "icon": "aggr",
            "layout": "boxed",
            "name": "aggr_hostgroup_boxed",
            "num_columns": 2,
            "painters": [
                ColumnSpec(name="host_state"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
                ColumnSpec(name="host_icons"),
                ColumnSpec(name="alias"),
                ColumnSpec(name="aggr_treestate_boxed"),
            ],
            "public": True,
            "single_infos": ["hostgroup"],
            "sorters": [
                SorterSpec(sorter="site", negate=False),
                SorterSpec(sorter="site_host", negate=False),
            ],
            "title": _l("Host group with BI state"),
            "user_sortable": True,
            "owner": UserId.builtin(),
            "link_from": {},
            "topic": "",
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        #   +----------------------------------------------------------------------+
        #   |       _   _       _   _  __ _           _   _                        |
        #   |      | \ | | ___ | |_(_)/ _(_) ___ __ _| |_(_) ___  _ __  ___        |
        #   |      |  \| |/ _ \| __| | |_| |/ __/ _` | __| |/ _ \| '_ \/ __|       |
        #   |      | |\  | (_) | |_| |  _| | (_| (_| | |_| | (_) | | | \__ \       |
        #   |      |_| \_|\___/ \__|_|_| |_|\___\__,_|\__|_|\___/|_| |_|___/       |
        #   |                                                                      |
        #   +----------------------------------------------------------------------+
        "hostnotifications": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log",
            "description": _l("Notification events of hosts."),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": True,
            "hidebutton": False,
            "icon": "notifications",
            "layout": "table",
            "mustsearch": False,
            "name": "hostnotifications",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_contact_name"),
                ColumnSpec(name="log_command"),
                ColumnSpec(name="log_state"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Notifications of host"),
            "topic": "history",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "log_class": {
                    "logclass0": "",
                    "logclass1": "",
                    "logclass2": "",
                    "logclass3": "on",
                    "logclass4": "",
                    "logclass5": "",
                    "logclass6": "",
                    "logclass8": "",
                },
                "serviceregex": {"service_regex": ""},
                "log_plugin_output": {"log_plugin_output": ""},
                "logtime": {"logtime_from": "90", "logtime_from_range": "86400"},
                "log_state": {},
                "log_notification_phase": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "hostsvcnotifications": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log",
            "description": _l(
                "All notification events concerning the state of a certain host (including services)"
            ),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": True,
            "hidebutton": False,
            "icon": "notifications",
            "layout": "table",
            "mustsearch": False,
            "name": "hostsvcnotifications",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_contact_name"),
                ColumnSpec(name="log_command"),
                ColumnSpec(name="log_type"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hostsvcnotifications"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svcnotifications"),
                ),
                ColumnSpec(name="log_state"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Notifications of host & services"),
            "topic": "history",
            "user_sortable": True,
            "single_infos": ["host"],
            "context": {
                "siteopt": {},
                "log_class": {
                    "logclass0": "",
                    "logclass1": "",
                    "logclass2": "",
                    "logclass3": "on",
                    "logclass4": "",
                    "logclass5": "",
                    "logclass6": "",
                    "logclass8": "",
                },
                "serviceregex": {"service_regex": ""},
                "log_plugin_output": {"log_plugin_output": ""},
                "logtime": {"logtime_from": "90", "logtime_from_range": "86400"},
                "log_state": {},
                "log_notification_phase": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "notifications": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log",
            "description": _l("All notification events of hosts or services."),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": False,
            "hidebutton": False,
            "icon": "notifications",
            "layout": "table",
            "mustsearch": False,
            "name": "notifications",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_contact_name"),
                ColumnSpec(name="log_command"),
                ColumnSpec(name="log_type"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hostsvcnotifications"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svcnotifications"),
                ),
                ColumnSpec(name="log_state"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Notifications of host & services"),
            "topic": "history",
            "sort_index": 20,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "log_class": {
                    "logclass0": "",
                    "logclass1": "",
                    "logclass2": "",
                    "logclass3": "on",
                    "logclass4": "",
                    "logclass5": "",
                    "logclass6": "",
                    "logclass8": "",
                },
                "siteopt": {"site": ""},
                "hostregex": {"host_regex": ""},
                "serviceregex": {"service_regex": ""},
                "log_plugin_output": {"log_plugin_output": ""},
                "logtime": {"logtime_from": "90", "logtime_from_range": "86400"},
                "log_state": {},
                "log_notification_phase": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "failed_notifications": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log",
            "description": _l("Failed notification events of hosts and services."),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": False,
            "hidebutton": True,
            "icon": {"icon": "notifications", "emblem": "warning"},
            "layout": "table",
            "mustsearch": False,
            "name": "failed_notifications",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_contact_name"),
                ColumnSpec(name="log_command"),
                ColumnSpec(name="log_type"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hostsvcnotifications"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svcnotifications"),
                ),
                ColumnSpec(name="log_state"),
                ColumnSpec(name="log_plugin_output"),
                ColumnSpec(name="log_comment"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Failed notifications"),
            "topic": "analyze",
            "sort_index": 40,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "log_class": {
                    "logclass0": "",
                    "logclass1": "",
                    "logclass2": "",
                    "logclass3": "on",
                    "logclass4": "",
                    "logclass5": "",
                    "logclass6": "",
                    "logclass8": "",
                },
                "log_type": {"log_type": ".*NOTIFICATION RESULT$"},
                "log_state": {
                    "logst_h0": "",
                    "logst_h1": "on",
                    "logst_h2": "on",
                    "logst_s0": "",
                    "logst_s1": "on",
                    "logst_s2": "on",
                    "logst_s3": "on",
                },
                "siteopt": {"site": ""},
                "hostregex": {"host_regex": ""},
                "serviceregex": {"service_regex": ""},
                "log_plugin_output": {"log_plugin_output": ""},
                "logtime": {"logtime_from": "90", "logtime_from_range": "86400"},
                "log_notification_phase": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "svcnotifications": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log",
            "description": _l("All notification events concerning the state of a certain service."),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": True,
            "hidebutton": False,
            "icon": "notifications",
            "layout": "table",
            "mustsearch": False,
            "name": "svcnotifications",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_contact_name"),
                ColumnSpec(name="log_command"),
                ColumnSpec(name="host"),
                ColumnSpec(name="log_state"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Service notifications"),
            "topic": "history",
            "public": True,
            "user_sortable": True,
            "single_infos": ["service", "host"],
            "context": {
                "siteopt": {},
                "log_class": {
                    "logclass0": "",
                    "logclass1": "",
                    "logclass2": "",
                    "logclass3": "on",
                    "logclass4": "",
                    "logclass5": "",
                    "logclass6": "",
                    "logclass8": "",
                },
                "log_plugin_output": {"log_plugin_output": ""},
                "logtime": {"logtime_from": "90", "logtime_from_range": "86400"},
                "log_state": {},
                "log_notification_phase": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        "contactnotifications": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log",
            "description": _l("All notification events sent to"),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": True,
            "hidebutton": False,
            "icon": "notifications",
            "layout": "table",
            "mustsearch": False,
            "name": "contactnotifications",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_command"),
                ColumnSpec(name="log_type"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hostsvcnotifications"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svcnotifications"),
                ),
                ColumnSpec(name="log_state"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Notifications of contact"),
            "topic": "history",
            "user_sortable": True,
            "single_infos": ["contact"],
            "context": {
                "log_class": {
                    "logclass0": "",
                    "logclass1": "",
                    "logclass2": "",
                    "logclass3": "on",
                    "logclass4": "",
                    "logclass5": "",
                    "logclass6": "",
                    "logclass8": "",
                },
                "host": {"host": ""},
                "serviceregex": {"service_regex": ""},
                "log_plugin_output": {"log_plugin_output": ""},
                "logtime": {"logtime_from": "90", "logtime_from_range": "86400"},
                "log_state": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        #   +----------------------------------------------------------------------+
        #   |     _    _           _     _                     _ _                 |
        #   |    / \  | | ___ _ __| |_  | |__   __ _ _ __   __| | | ___ _ __ ___   |
        #   |   / _ \ | |/ _ \ '__| __| | '_ \ / _` | '_ \ / _` | |/ _ \ '__/ __|  |
        #   |  / ___ \| |  __/ |  | |_  | | | | (_| | | | | (_| | |  __/ |  \__ \  |
        #   | /_/   \_\_|\___|_|   \__| |_| |_|\__,_|_| |_|\__,_|_|\___|_|  |___/  |
        #   |                                                                      |
        #   +----------------------------------------------------------------------+
        "alerthandlers": {
            "browser_reload": 0,
            "column_headers": "pergroup",
            "datasource": "log",
            "description": _l("All alert handler executions."),
            "group_painters": [ColumnSpec(name="log_date")],
            "hidden": False,
            "hidebutton": False,
            "icon": "alert_handlers",
            "layout": "table",
            "mustsearch": False,
            "name": "alerthandlers",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(name="log_command"),
                ColumnSpec(name="log_type"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hoststatus"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="log_state"),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [
                SorterSpec(sorter="log_time", negate=True),
                SorterSpec(sorter="log_lineno", negate=True),
            ],
            "title": _l("Alert handler executions"),
            "topic": "analyze",
            "sort_index": 20,
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "log_class": {
                    "logclass0": "",
                    "logclass1": "",
                    "logclass2": "",
                    "logclass3": "",
                    "logclass4": "",
                    "logclass5": "",
                    "logclass6": "",
                    "logclass8": "on",
                },
                "siteopt": {"site": ""},
                "hostregex": {"host_regex": ""},
                "serviceregex": {"service_regex": ""},
                "log_plugin_output": {"log_plugin_output": ""},
                "logtime": {"logtime_from": "90", "logtime_from_range": "86400"},
                "log_state": {},
                "log_notification_phase": {},
            },
            "link_from": {},
            "add_context_to_title": True,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
    }
)

_host_view_context = {
    "host_acknowledged": {"is_host_acknowledged": "-1"},
    "host_check_command": {"host_check_command": ""},
    "host_in_notification_period": {"is_host_in_notification_period": "-1"},
    "host_in_service_period": {"is_host_in_service_period": "-1"},
    "host_notifications_enabled": {"is_host_notifications_enabled": "-1"},
    "host_scheduled_downtime_depth": {"is_host_scheduled_downtime_depth": "-1"},
    "host_tags": {
        "host_tag_0_grp": "",
        "host_tag_0_op": "",
        "host_tag_0_val": "",
        "host_tag_1_grp": "",
        "host_tag_1_op": "",
        "host_tag_1_val": "",
        "host_tag_2_grp": "",
        "host_tag_2_op": "",
        "host_tag_2_val": "",
    },
    "hostalias": {"hostalias": "", "neg_hostalias": ""},
    "hostgroups": {"hostgroups": "", "neg_hostgroups": ""},
    "hostregex": {"host_regex": "", "neg_host_regex": ""},
    "hoststate": {"hoststate_filled": "1", "hst0": "on", "hst1": "on", "hst2": "on", "hstp": "on"},
    "opthost_contactgroup": {"neg_opthost_contact_group": "", "opthost_contact_group": ""},
    "opthostgroup": {"neg_opthost_group": "", "opthost_group": ""},
    "siteopt": {"site": ""},
}


def _simple_host_view(custom_attributes, add_context=None):
    context = _host_view_context.copy()
    if add_context:
        context.update(add_context)

    view_spec = {
        "browser_reload": 30,
        "column_headers": "pergroup",
        "datasource": "hosts",
        "force_checkboxes": False,
        "hidden": False,
        "hidebutton": False,
        "icon": None,
        "layout": "table",
        "mobile": False,
        "mustsearch": False,
        "num_columns": 1,
        "play_sounds": False,
        "user_sortable": True,
        "context": context,
        "group_painters": [
            ColumnSpec(name="sitealias"),
        ],
        "painters": [],
        "single_infos": [],
        "sorters": [
            SorterSpec(sorter="site", negate=False),
            SorterSpec(sorter="site_host", negate=False),
        ],
        "owner": UserId.builtin(),
        "public": True,
        "link_from": {},
        "is_show_more": False,
        "packaged": False,
        "main_menu_search_terms": [],
    }

    view_spec.update(custom_attributes)
    return view_spec


builtin_views["docker_nodes"] = _simple_host_view(
    {
        "title": _l("Docker nodes"),
        "topic": "applications",
        "icon": "docker",
        "sort_index": 10,
        "description": _l(
            "Overall state of all docker nodes, with counts of services in the various states."
        ),
        "add_context_to_title": False,
        "painters": [
            *host_view_painters,
            ColumnSpec(name="inv_software_applications_docker_version"),
            ColumnSpec(name="inv_software_applications_docker_num_containers_total"),
            ColumnSpec(name="inv_software_applications_docker_num_containers_running"),
            ColumnSpec(name="inv_software_applications_docker_num_containers_paused"),
            ColumnSpec(name="inv_software_applications_docker_num_containers_stopped"),
        ],
        "name": "docker_nodes",
    },
    add_context={
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/docker_object:node"],
            object_type="host",
        )
    },
)

builtin_views["docker_containers"] = _simple_host_view(
    {
        "title": _l("Docker containers"),
        "topic": "applications",
        "icon": "docker",
        "sort_index": 20,
        "description": _l(
            "Overall state of all docker containers, with counts of services in the various states."
        ),
        "add_context_to_title": False,
        "painters": [
            *host_view_painters,
            ColumnSpec(name="host_docker_node"),
            ColumnSpec(
                name="perfometer",
                join_value="CPU utilization",
            ),
            ColumnSpec(
                name="perfometer",
                join_value="Memory",
            ),
            ColumnSpec(
                name="perfometer",
                join_value="Uptime",
            ),
        ],
        "name": "docker_containers",
    },
    add_context={
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/docker_object:container"],
            object_type="host",
        )
    },
)

builtin_views["vsphere_servers"] = _simple_host_view(
    {
        "title": _l("vSphere Servers"),
        "topic": "applications",
        "icon": "vsphere",
        "sort_index": 30,
        "description": _l(
            "Overall state of all vSphere servers, with counts of services in the various states."
        ),
        "add_context_to_title": False,
        "painters": host_view_painters,
        "name": "vsphere_servers",
    },
    add_context={
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/vsphere_object:server"],
            object_type="host",
        )
    },
)

builtin_views["vpshere_vms"] = _simple_host_view(
    {
        "title": _l("vSphere VMs"),
        "topic": "applications",
        "icon": "vsphere",
        "sort_index": 40,
        "description": _l("Overall state of all vSphere based virtual machines."),
        "add_context_to_title": False,
        "painters": [
            *host_view_painters,
            ColumnSpec(
                name="svc_plugin_output",
                join_value="ESX Hostsystem",
                column_title="Server",
            ),
            ColumnSpec(
                name="perfometer",
                join_value="CPU utilization",
            ),
            ColumnSpec(
                name="perfometer",
                join_value="ESX Memory",
            ),
            ColumnSpec(
                name="svc_plugin_output",
                join_value="ESX Guest Tools",
                column_title="Guest tools",
            ),
        ],
        "name": "vpshere_vms",
    },
    add_context={
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/vsphere_object:vm"],
            object_type="host",
        )
    },
)

builtin_views["crash_reports"] = {
    "description": _l("List crash reports of all sites"),
    "title": _l("Crash reports"),
    "browser_reload": 0,
    "column_headers": "pergroup",
    "context": {},
    "datasource": "crash_reports",
    "force_checkboxes": False,
    "group_painters": [
        ColumnSpec(name="sitealias"),
    ],
    "hidden": False,
    "hidebutton": False,
    "icon": "crash",
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "name": "crash_reports",
    "num_columns": 1,
    "painters": [
        ColumnSpec(name="crash_ident"),
        ColumnSpec(name="crash_type"),
        ColumnSpec(name="crash_source"),
        ColumnSpec(name="crash_version"),
        ColumnSpec(name="crash_time"),
        ColumnSpec(name="crash_exception"),
    ],
    "play_sounds": False,
    "single_infos": [],
    "sorters": [
        SorterSpec(sorter="sitealias", negate=False),
        SorterSpec(sorter="crash_time", negate=True),
    ],
    "user_sortable": True,
    "topic": "analyze",
    "sort_index": 30,
    "is_show_more": True,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "add_context_to_title": True,
    "packaged": False,
    "main_menu_search_terms": [],
}

builtin_views["cmk_servers"] = {
    "add_context_to_title": False,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "context": {
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/check_mk_server:yes"],
            object_type="host",
        )
    },
    "datasource": "hosts",
    "description": _l("Displaying the overall state of Checkmk servers\n"),
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": True,
    "hidebutton": True,
    "icon": "checkmk",
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "name": "cmk_servers",
    "num_columns": 1,
    "painters": [
        ColumnSpec(
            name="host",
            parameters=PainterParameters(
                color_choices=[
                    "colorize_up",
                    "colorize_down",
                    "colorize_unreachable",
                    "colorize_pending",
                    "colorize_downtime",
                ]
            ),
            link_spec=VisualLinkSpec(type_name="views", name="host"),
            tooltip="host_addresses",
        ),
        ColumnSpec(
            name="inv_software_os_name",
            parameters=PainterParameters(use_short=True),
        ),
        ColumnSpec(
            name="inv_hardware_cpu_cores",
            parameters=PainterParameters(use_short=True),
        ),
        ColumnSpec(
            name="inv_hardware_memory_total_ram_usable",
            parameters=PainterParameters(use_short=True),
        ),
        ColumnSpec(
            name="perfometer",
            join_value="CPU utilization",
        ),
        ColumnSpec(
            name="perfometer",
            join_value="CPU load",
        ),
        ColumnSpec(
            name="perfometer",
            join_value="Memory",
        ),
        ColumnSpec(
            name="perfometer",
            join_value="Disk IO SUMMARY",
        ),
    ],
    "play_sounds": False,
    "single_infos": [],
    "sorters": [
        SorterSpec(sorter="sitealias", negate=False),
        SorterSpec(sorter="host_name", negate=False),
    ],
    "user_sortable": True,
    "title": _l("Checkmk servers"),
    "topic": "analyze",
    "sort_index": 6,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "is_show_more": False,
    "packaged": False,
    "main_menu_search_terms": [],
}


def cmk_sites_painters() -> Sequence[ColumnSpec]:
    service_painters: list[Any] = []
    if cmk_version.edition(paths.omd_root) is not cmk_version.Edition.CRE:
        service_painters += [
            ColumnSpec(name="invcmksites_cmc"),
            ColumnSpec(name="invcmksites_dcd"),
            ColumnSpec(name="invcmksites_liveproxyd"),
            ColumnSpec(name="invcmksites_mknotifyd"),
        ]
    else:
        service_painters += [
            ColumnSpec(name="invcmksites_nagios"),
        ]

    service_painters += [
        ColumnSpec(name="invcmksites_mkeventd"),
        ColumnSpec(name="invcmksites_apache"),
        ColumnSpec(name="invcmksites_rrdcached"),
        ColumnSpec(name="invcmksites_xinetd"),
        ColumnSpec(name="invcmksites_crontab"),
        ColumnSpec(name="invcmksites_stunnel"),
    ]

    if cmk_version.edition(paths.omd_root) is cmk_version.Edition.CRE:
        service_painters += [
            ColumnSpec(name="invcmksites_npcd"),
        ]

    return [
        ColumnSpec(
            name="host",
            parameters=PainterParameters(
                color_choices=[
                    "colorize_up",
                    "colorize_down",
                    "colorize_unreachable",
                    "colorize_pending",
                    "colorize_downtime",
                ]
            ),
            link_spec=VisualLinkSpec(type_name="views", name="host"),
            tooltip="host_addresses",
        ),
        ColumnSpec(name="invcmksites_site"),
        ColumnSpec(name="invcmksites_used_version"),
        ColumnSpec(name="invcmksites_num_hosts"),
        ColumnSpec(name="invcmksites_num_services"),
        ColumnSpec(name="invcmksites_check_helper_usage"),
        ColumnSpec(name="invcmksites_fetcher_helper_usage"),
        ColumnSpec(name="invcmksites_checker_helper_usage"),
        ColumnSpec(name="invcmksites_livestatus_usage"),
    ] + service_painters


builtin_views["cmk_sites"] = {
    "add_context_to_title": False,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "context": {
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/check_mk_server:yes"],
            object_type="host",
        )
    },
    "datasource": "invcmksites",
    "description": _l("Displaying the state of Checkmk sites\n"),
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": True,
    "hidebutton": True,
    "icon": "checkmk",
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "name": "cmk_sites",
    "num_columns": 1,
    "painters": cmk_sites_painters(),
    "play_sounds": False,
    "single_infos": [],
    "sorters": [
        SorterSpec(sorter="sitealias", negate=False),
        SorterSpec(sorter="host_name", negate=False),
    ],
    "user_sortable": True,
    "title": _l("Checkmk sites"),
    "topic": "analyze",
    "sort_index": 7,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "is_show_more": False,
    "packaged": False,
    "main_menu_search_terms": [],
}

builtin_views["cmk_sites_of_host"] = {
    "add_context_to_title": True,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "context": {},
    "datasource": "invcmksites",
    "description": _l("Displaying the state of Checkmk sites of the given host\n"),
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": True,
    "hidebutton": True,
    "icon": "checkmk",
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "name": "cmk_sites_of_host",
    "num_columns": 1,
    "painters": cmk_sites_painters(),
    "play_sounds": False,
    "single_infos": ["host"],
    "sorters": [
        SorterSpec(sorter="sitealias", negate=False),
        SorterSpec(sorter="host_name", negate=False),
    ],
    "user_sortable": True,
    "title": _l("Checkmk sites of host"),
    "topic": "applications",
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "sort_index": 99,
    "is_show_more": False,
    "packaged": False,
    "main_menu_search_terms": [],
}

#   +------------------------------------------------------------+
#   |  ___ _____   _____  __  __ _      _                        |
#   | |_ _|_   _| | ____|/ _|/ _(_) ___(_) ___ _ __   ___ _   _  |
#   |  | |  | |   |  _| | |_| |_| |/ __| |/ _ \ '_ \ / __| | | | |
#   |  | |  | |   | |___|  _|  _| | (__| |  __/ | | | (__| |_| | |
#   | |___| |_|   |_____|_| |_| |_|\___|_|\___|_| |_|\___|\__, | |
#   |                                                     |___/  |
#   +------------------------------------------------------------+

builtin_views["it_efficiency_servers_cpumem_linux"] = {
    "name": "it_efficiency_servers_cpumem_linux",
    "title": "Linux [CPU & Memory]",
    "description": _l("Measure the CPU and Memory efficiency of your Linux servers\n"),
    "datasource": "hosts",
    "context": {
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/os_family:linux"],
            object_type="host",
        )
    },
    "painters": [
        ColumnSpec(
            name="host",
            link_spec=VisualLinkSpec(type_name="views", name="host"),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="util",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="CPU utilization (last 365d)",
                uuid="37c949ff-83a2-4f2d-8d00-c9830668fbee",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="CPU utilization",
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="mem_used_percent",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Memory utilization (last 365d)",
                uuid="12113b2c-4b41-4315-a1e9-804d2770ce67",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="Memory",
        ),
        ColumnSpec(
            name="inv_hardware_cpu_cores",
            column_title="CPU cores",
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="mem_total",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Memory installed (last 365d)",
                uuid="34a13b2c-4b41-4315-a1e9-804d2770ce67",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="Memory",
        ),
    ],
    "topic": "it_efficiency",
    "add_context_to_title": False,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": False,
    "hidebutton": False,
    "icon": None,
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "num_columns": 1,
    "sorters": [],
    "play_sounds": False,
    "single_infos": [],
    "user_sortable": True,
    "sort_index": 99,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "is_show_more": True,
    "packaged": False,
    "main_menu_search_terms": [],
}

builtin_views["it_efficiency_servers_cpumem_esxi"] = {
    "name": "it_efficiency_servers_cpumem_esxi",
    "title": "VMware ESXi [CPU & Memory]",
    "topic": "it_efficiency",
    "description": _l("Measure the CPU and Memory efficiency of your VMware ESXi servers\n"),
    "datasource": "hosts",
    "context": {
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/vsphere_object:server"],
            object_type="host",
        )
    },
    "painters": [
        ColumnSpec(
            name="host",
            link_spec=VisualLinkSpec(type_name="views", name="host"),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="util",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="CPU utilization (last 365d)",
                uuid="37c949ff-83a2-4f2d-8d00-c9830668fbee",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="CPU utilization",
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="mem_used",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Memory used (last 365d)",
                uuid="12113b2c-4b41-4315-a1e9-804d2770ce67",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="Memory",
        ),
        ColumnSpec(
            name="inv_hardware_cpu_cores",
            column_title="CPU cores",
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="mem_total",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Memory installed (last 365d)",
                uuid="326d4d9a-8651-4389-9216-2ef20e32f17c",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="Memory",
        ),
    ],
    "add_context_to_title": False,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": False,
    "hidebutton": False,
    "icon": None,
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "num_columns": 1,
    "sorters": [],
    "play_sounds": False,
    "single_infos": [],
    "user_sortable": True,
    "sort_index": 99,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "is_show_more": True,
    "packaged": False,
    "main_menu_search_terms": [],
}

builtin_views["it_efficiency_servers_cpumem_nutanix"] = {
    "name": "it_efficiency_servers_cpumem_nutanix",
    "title": "Nutanix [CPU & Memory]",
    "topic": "it_efficiency",
    "description": _l("Measure the CPU and Memory efficiency of your Nutanix servers\n"),
    "datasource": "hosts",
    "context": {
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/nutanix/object:control_plane"],
            object_type="host",
        )
    },
    "painters": [
        ColumnSpec(
            name="host",
            link_spec=VisualLinkSpec(type_name="views", name="host"),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="util",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="CPU utilization (last 365d)",
                uuid="37c949ff-83a2-4f2d-8d00-c9830668fbee",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="NTNX Cluster CPU",
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="prism_cluster_mem_used",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Memory utilization (last 365d)",
                uuid="12113b2c-4b41-4315-a1e9-804d2770ce67",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="NTNX Cluster Memory",
        ),
    ],
    "add_context_to_title": False,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": False,
    "hidebutton": False,
    "icon": None,
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "num_columns": 1,
    "sorters": [],
    "play_sounds": False,
    "single_infos": [],
    "user_sortable": True,
    "sort_index": 99,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "is_show_more": True,
    "packaged": False,
    "main_menu_search_terms": [],
}

builtin_views["it_efficiency_servers_cpumem_windows"] = {
    "name": "it_efficiency_servers_cpumem_windows",
    "title": "Windows [CPU & Memory]",
    "topic": "it_efficiency",
    "description": _l("Measure the CPU and Memory efficiency of your Windows servers\n"),
    "datasource": "hosts",
    "context": {
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/os_family:windows"],
            object_type="host",
        )
    },
    "painters": [
        ColumnSpec(
            name="host",
            link_spec=VisualLinkSpec(type_name="views", name="host"),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="util_numcpu_as_max",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="CPU utilization (last 365d)",
                uuid="37c949ff-83a2-4f2d-8d00-c9830668fbee",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="CPU utilization",
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="mem_used_percent",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Memory utilization (last 365d)",
                uuid="12113b2c-4b41-4315-a1e9-804d2770ce67",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="Memory",
        ),
        ColumnSpec(
            name="inv_hardware_cpu_cores",
            column_title="CPU cores",
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="mem_total",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Memory installed (last 365d)",
                uuid="34a13b2c-4b41-4315-a1e9-804d2770ce67",
            ),
            link_spec=VisualLinkSpec(type_name="views", name="service"),
            join_value="Memory",
        ),
    ],
    "add_context_to_title": False,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": False,
    "hidebutton": False,
    "icon": None,
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "num_columns": 1,
    "sorters": [],
    "play_sounds": False,
    "single_infos": [],
    "user_sortable": True,
    "sort_index": 99,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "is_show_more": True,
    "packaged": False,
    "main_menu_search_terms": [],
}

builtin_views["it_efficiency_servers_fs_linux"] = {
    "name": "it_efficiency_servers_fs_linux",
    "title": "Linux [Filesystems]",
    "topic": "it_efficiency",
    "description": _l("Measure the Filesystem efficiency of your Linux servers.\n"),
    "datasource": "services",
    "context": {
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/os_family:linux"],
            object_type="host",
        ),
        "serviceregex": {"service_regex": "^Filesystem*", "neg_service_regex": ""},
    },
    "painters": [
        ColumnSpec(
            name="host",
            link_spec=VisualLinkSpec(type_name="views", name="host"),
        ),
        ColumnSpec(
            name="service_description",
            link_spec=VisualLinkSpec(type_name="views", name="service"),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="fs_used_percent",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Filesystem utilization (last 365d)",
                uuid="6615ead2-a56e-4acb-9ffd-9ad9502aa4a9",
            ),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="fs_size",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Filesystem size (last 365d)",
                uuid="cef4df25-eb3b-41c7-9ccb-e4b3cc15cb55",
            ),
        ),
    ],
    "add_context_to_title": False,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": False,
    "hidebutton": False,
    "icon": None,
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "num_columns": 1,
    "sorters": [],
    "play_sounds": False,
    "single_infos": [],
    "user_sortable": True,
    "sort_index": 99,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "is_show_more": True,
    "packaged": False,
    "main_menu_search_terms": [],
}

builtin_views["it_efficiency_servers_fs_windows"] = {
    "name": "it_efficiency_servers_fs_windows",
    "title": "Windows [Filesystems]",
    "topic": "it_efficiency",
    "description": _l("Measure the Filesystem efficiency of your Windows servers\n"),
    "datasource": "services",
    "context": {
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/os_family:windows"],
            object_type="host",
        ),
        "serviceregex": {"service_regex": "^Filesystem*", "neg_service_regex": ""},
    },
    "painters": [
        ColumnSpec(
            name="host",
            link_spec=VisualLinkSpec(type_name="views", name="host"),
        ),
        ColumnSpec(
            name="service_description",
            link_spec=VisualLinkSpec(type_name="views", name="service"),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="fs_used_percent",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Filesystem utilization (last 365d)",
                uuid="6615ead2-a56e-4acb-9ffd-9ad9502aa4a9",
            ),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="fs_size",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Filesystem size (last 365d)",
                uuid="cef4df25-eb3b-41c7-9ccb-e4b3cc15cb55",
            ),
        ),
    ],
    "add_context_to_title": False,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": False,
    "hidebutton": False,
    "icon": None,
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "num_columns": 1,
    "sorters": [],
    "play_sounds": False,
    "single_infos": [],
    "user_sortable": True,
    "sort_index": 99,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "is_show_more": True,
    "packaged": False,
    "main_menu_search_terms": [],
}

builtin_views["it_efficiency_servers_fs_esxi"] = {
    "name": "it_efficiency_servers_fs_esxi",
    "title": "VMware ESXi [Filesystems]",
    "topic": "it_efficiency",
    "description": _l("Measure the Filesystem efficiency of your VMware ESXi servers\n"),
    "datasource": "services",
    "context": {
        "host_labels": filter_http_vars_for_simple_label_group(
            labels=["cmk/vsphere_object:server"],
            object_type="host",
        ),
        "serviceregex": {"service_regex": "^Filesystem*", "neg_service_regex": ""},
    },
    "painters": [
        ColumnSpec(
            name="host",
            link_spec=VisualLinkSpec(type_name="views", name="host"),
        ),
        ColumnSpec(
            name="service_description",
            link_spec=VisualLinkSpec(type_name="views", name="service"),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="fs_used_percent",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Filesystem utilization (last 365d)",
                uuid="6615ead2-a56e-4acb-9ffd-9ad9502aa4a9",
            ),
        ),
        ColumnSpec(
            name="svc_metrics_hist",
            parameters=PainterParameters(
                metric="fs_size",
                rrd_consolidation="average",
                time_range=("age", 31536000),
                aggregation="avg",
                column_title="Filesystem size (last 365d)",
                uuid="cef4df25-eb3b-41c7-9ccb-e4b3cc15cb55",
            ),
        ),
    ],
    "add_context_to_title": False,
    "browser_reload": 0,
    "column_headers": "pergroup",
    "force_checkboxes": False,
    "group_painters": [],
    "hidden": False,
    "hidebutton": False,
    "icon": None,
    "layout": "table",
    "mobile": False,
    "mustsearch": False,
    "num_columns": 1,
    "sorters": [],
    "play_sounds": False,
    "single_infos": [],
    "user_sortable": True,
    "sort_index": 99,
    "owner": UserId.builtin(),
    "public": True,
    "link_from": {},
    "is_show_more": True,
    "packaged": False,
    "main_menu_search_terms": [],
}

# FIXME: Can be removed once all dashboards have been converted
# to have the view definitions right inside the dashboards
builtin_views.update(
    {
        # A similar view, used in the dashboard
        "hostproblems_dash": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "hosts",
            "description": _l(
                "A complete list of all host problems, optimized for usage in the dashboard"
            ),
            "group_painters": [],
            "hidden": True,
            "hidebutton": True,
            "layout": "table",
            "mustsearch": False,
            "name": "hostproblems_dash",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="host_state"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
                ColumnSpec(name="host_icons"),
                ColumnSpec(name="host_state_age"),
                ColumnSpec(name="host_plugin_output"),
            ],
            "public": True,
            "sorters": [SorterSpec(sorter="hoststate", negate=True)],
            "title": _l("Host problems"),
            "topic": "",
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "host_scheduled_downtime_depth": {"is_host_scheduled_downtime_depth": "0"},
                "hoststate": {"hst0": "", "hst1": "on", "hst2": "on", "hstp": ""},
                "host_acknowledged": {"is_host_acknowledged": "0"},
            },
            "link_from": {},
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Similar view, but for the dashboard
        "svcproblems_dash": {
            "browser_reload": 30,
            "column_headers": "pergroup",
            "datasource": "services",
            "description": _l(
                "All non-downtime, non-acknownledged services, used for the dashbaord"
            ),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "svcproblems_dash",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="service_state"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="host"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="service"),
                ),
                ColumnSpec(name="service_icons"),
                ColumnSpec(name="svc_plugin_output"),
                ColumnSpec(name="svc_state_age"),
                ColumnSpec(name="svc_check_age"),
            ],
            "play_sounds": True,
            "public": True,
            "sorters": [
                SorterSpec(sorter="svcstate", negate=True),
                SorterSpec(sorter="stateage", negate=False),
                SorterSpec(sorter="svcdescr", negate=False),
            ],
            "title": _l("Service problems"),
            "topic": "",
            "user_sortable": True,
            "single_infos": [],
            "context": {
                "service_acknowledged": {"is_service_acknowledged": "0"},
                "svcstate": {"st0": "", "st1": "on", "st2": "on", "st3": "on", "stp": ""},
                "hoststate": {"hst0": "on", "hst1": "", "hst2": "", "hstp": "on"},
                "in_downtime": {"is_in_downtime": "0"},
            },
            "link_from": {},
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
        # Similar view, but for dashboard
        "events_dash": {
            "browser_reload": 90,
            "column_headers": "pergroup",
            "datasource": "log_events",
            "description": _l("Events of the last 4 hours."),
            "group_painters": [],
            "hidden": True,
            "hidebutton": False,
            "layout": "table",
            "mustsearch": False,
            "name": "events_dash",
            "num_columns": 1,
            "owner": UserId.builtin(),
            "painters": [
                ColumnSpec(name="log_icon"),
                ColumnSpec(name="log_time"),
                ColumnSpec(
                    name="host",
                    link_spec=VisualLinkSpec(type_name="views", name="hostsvcevents"),
                ),
                ColumnSpec(
                    name="service_description",
                    link_spec=VisualLinkSpec(type_name="views", name="svcevents"),
                ),
                ColumnSpec(name="log_plugin_output"),
            ],
            "play_sounds": False,
            "public": True,
            "sorters": [],
            "title": _l("Events of the last 4 hours (for the dashboard)"),
            "topic": "",
            "user_sortable": True,
            "single_infos": [],
            "context": {"logtime": {"logtime_from": "4", "logtime_from_range": "3600"}},
            "link_from": {},
            "icon": None,
            "add_context_to_title": True,
            "sort_index": 99,
            "is_show_more": False,
            "packaged": False,
            "main_menu_search_terms": [],
        },
    }
)


@dataclass(frozen=True)
class BuiltinViewExtender:
    ident: str
    callable: Callable[
        [Mapping[ViewName, ViewSpec], DataSourceRegistry, Config], dict[ViewName, ViewSpec]
    ]


class BuiltinViewExtenderRegistry(Registry[BuiltinViewExtender]):
    def plugin_name(self, instance: BuiltinViewExtender) -> str:
        return instance.ident


def noop_builtin_view_extender(
    views: Mapping[ViewName, ViewSpec], data_source_registry: DataSourceRegistry, config: Config
) -> dict[ViewName, ViewSpec]:
    return {**views}


builtin_view_extender_registry = BuiltinViewExtenderRegistry()
